re #142872. Ignore whitespace only content error.

This commit is contained in:
rebornix 2022-02-14 17:58:35 -08:00
parent d7ca9f570f
commit 7f99539fe7
No known key found for this signature in database
GPG key ID: 181FC90D15393C20

View file

@ -22,7 +22,7 @@ export class NotebookSerializer implements vscode.NotebookSerializer {
} catch {
}
let json = contents ? (JSON.parse(contents) as Partial<nbformat.INotebookContent>) : {};
let json = contents && /\S/.test(contents) ? (JSON.parse(contents) as Partial<nbformat.INotebookContent>) : {};
if (json.__webview_backup) {
const backupId = json.__webview_backup;