Skip to content
Snippets Groups Projects
Commit a357e9bc authored by dakkar's avatar dakkar
Browse files

merge: fix exception when logging IP addresses (!644)

View MR for information: TransFem-org/Sharkey!644



Approved-by: default avatardakkar <dakkar@thenautilus.net>
Approved-by: default avatarMarie <github@yuugi.dev>
parents 72baaaab 3defed6a
No related branches found
No related tags found
No related merge requests found
Pipeline #1292 canceled with stages
......@@ -260,6 +260,11 @@ export class ApiCallService implements OnApplicationShutdown {
const meta = await this.metaService.fetch();
if (!meta.enableIpLogging) return;
const ip = request.ip;
if (!ip) {
this.logger.warn(`user ${user.id} has a null IP address; please check your network configuration.`);
return;
}
const ips = this.userIpHistories.get(user.id);
if (ips == null || !ips.has(ip)) {
if (ips == null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment