From 151ba0b0ee9fcccbaf857dcfc2f54ff61478f00e Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 14 Mar 2018 15:11:58 -0700 Subject: [PATCH] Don't try parsing `undefined` as json Fixes #45804 --- src/vs/editor/contrib/suggest/suggestMemory.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/suggest/suggestMemory.ts b/src/vs/editor/contrib/suggest/suggestMemory.ts index 7ead0af993a..6351ea04471 100644 --- a/src/vs/editor/contrib/suggest/suggestMemory.ts +++ b/src/vs/editor/contrib/suggest/suggestMemory.ts @@ -192,7 +192,9 @@ export class SuggestMemories { try { const raw = this._storageService.get(`${this._storagePrefix}/${this._mode}`, StorageScope.WORKSPACE); - this._strategy.fromJSON(JSON.parse(raw)); + if (raw) { + this._strategy.fromJSON(JSON.parse(raw)); + } } catch (e) { // things can go wrong with JSON... } -- GitLab