diff --git a/apps/server/src/diagnostics/ProcessDiagnostics.ts b/apps/server/src/diagnostics/ProcessDiagnostics.ts index 83b4a8ea32..c2c8bd49f5 100644 --- a/apps/server/src/diagnostics/ProcessDiagnostics.ts +++ b/apps/server/src/diagnostics/ProcessDiagnostics.ts @@ -154,11 +154,15 @@ const decodeWindowsProcessRowsJson = Schema.decodeUnknownOption(WindowsProcessRo const decodeWindowsProcessRowJson = Schema.decodeUnknownOption(WindowsProcessRowJson); function positiveIntegerOption(value: number | undefined): Option.Option { - return Number.isInteger(value) && value > 0 ? Option.some(value) : Option.none(); + return typeof value === "number" && Number.isInteger(value) && value > 0 + ? Option.some(value) + : Option.none(); } function nonNegativeIntegerOption(value: number | undefined): Option.Option { - return Number.isInteger(value) && value >= 0 ? Option.some(value) : Option.none(); + return typeof value === "number" && Number.isInteger(value) && value >= 0 + ? Option.some(value) + : Option.none(); } export function parsePosixProcessRows(output: string): ReadonlyArray {