Skip to content
This repository was archived by the owner on Dec 15, 2019. It is now read-only.

Commit 7d1e520

Browse files
committed
Provide fallback values if ip-lookup failed
1 parent 5da0957 commit 7d1e520

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/websocket.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ const websocket = {
5656

5757
ws._sessionInfo = {
5858
id: Math.floor(Math.random() * 1e15).toString(16) + Date.now().toString(16),
59-
city: lu.city,
60-
country: i18nCountries.getName(lu.country, 'en'),
59+
city: lu ? lu.city : 'Unknown',
60+
country: lu ? i18nCountries.getName(lu.country, 'en') : 'Unknown',
6161
device: userAgentParser(req.headers['user-agent'])
6262
};
6363

0 commit comments

Comments
 (0)