mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-13 21:40:45 +01:00
fix exception when logging IP addresses
This commit is contained in:
parent
b151d19325
commit
3defed6a19
1 changed files with 5 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue