diff options
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index 69ed725d52..a52c3b431a 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -387,7 +387,12 @@ export class DaemonRpc { public async getLocation(): Promise<ILocation | undefined> { const response = await this.transport.send('get_current_location', [], NETWORK_CALL_TIMEOUT); try { - return camelCaseObjectKeys(validate(locationSchema, response)) as ILocation; + const validatedObject = validate(locationSchema, response); + if (validatedObject) { + return camelCaseObjectKeys(validatedObject) as ILocation; + } else { + return undefined; + } } catch (error) { throw new ResponseParseError('Invalid response from get_current_location', error); } |
