From 06c7ad89a7ced4dd4f0930e40c29c1f3ef9484fd Mon Sep 17 00:00:00 2001 From: thomaswp Date: Mon, 26 Sep 2016 14:27:44 -0400 Subject: [PATCH] Fixed #1428, an issue with preview the (empty) project placeholder. The code treats this placeholder the same as any other proejct and attempts to open it, leading to a parse error. --- gui.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/gui.js b/gui.js index 7d9f0456cc..d9b4b38937 100644 --- a/gui.js +++ b/gui.js @@ -5440,16 +5440,19 @@ ProjectDialogMorph.prototype.setSource = function (source) { if (myself.task === 'open') { src = localStorage['-snap-project-' + item.name]; - xml = myself.ide.serializer.parse(src); - - myself.notesText.text = xml.childNamed('notes').contents - || ''; - myself.notesText.drawNew(); - myself.notesField.contents.adjustBounds(); - myself.preview.texture = xml.childNamed('thumbnail').contents - || null; - myself.preview.cachedTexture = null; - myself.preview.drawNew(); + + if (src) { + xml = myself.ide.serializer.parse(src); + + myself.notesText.text = xml.childNamed('notes').contents + || ''; + myself.notesText.drawNew(); + myself.notesField.contents.adjustBounds(); + myself.preview.texture = + xml.childNamed('thumbnail').contents || null; + myself.preview.cachedTexture = null; + myself.preview.drawNew(); + } } myself.edit(); };