diff --git a/src/Utilities.ts b/src/Utilities.ts index d406e26..414af47 100644 --- a/src/Utilities.ts +++ b/src/Utilities.ts @@ -36,7 +36,7 @@ const bannedCharacters = /[&<>\"'\r\n]/g; export class Utilities { public static getRealIP(obj: Indexable): string { - return (obj[Config.instance.dev.sourceIpHeader] as string).split(',')[0]; + return (obj[Config.instance.dev.sourceIpHeader] as string)?.split(',')[0] || ""; } public static isRunningInDocker(): boolean {