From bbeadfa937230d76f536cffc564997de9437842c Mon Sep 17 00:00:00 2001 From: Yuji Hirose Date: Wed, 27 Feb 2019 09:04:58 -0500 Subject: [PATCH] Fixed problem with PEG Playground when grammar or code text is empty --- docs/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.js b/docs/index.js index efcffc4..6622316 100644 --- a/docs/index.js +++ b/docs/index.js @@ -1,12 +1,12 @@ // Setup editros const grammar = ace.edit("grammar-editor"); grammar.setShowPrintMargin(false); -grammar.setValue(localStorage.getItem('grammarText')); +grammar.setValue(localStorage.getItem('grammarText') || ''); grammar.moveCursorTo(0, 0); const code = ace.edit("code-editor"); code.setShowPrintMargin(false); -code.setValue(localStorage.getItem('codeText')); +code.setValue(localStorage.getItem('codeText') || ''); code.moveCursorTo(0, 0); const codeAst = ace.edit("code-ast");