diff --git a/extensions/ipynb/src/notebookSerializer.ts b/extensions/ipynb/src/notebookSerializer.ts index a9331529728..7d5cef2b3d3 100644 --- a/extensions/ipynb/src/notebookSerializer.ts +++ b/extensions/ipynb/src/notebookSerializer.ts @@ -22,7 +22,7 @@ export class NotebookSerializer implements vscode.NotebookSerializer { } catch { } - let json = contents ? (JSON.parse(contents) as Partial) : {}; + let json = contents && /\S/.test(contents) ? (JSON.parse(contents) as Partial) : {}; if (json.__webview_backup) { const backupId = json.__webview_backup;