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.
dev
thomaswp 2016-09-26 14:27:44 -04:00
rodzic 60942484e6
commit 06c7ad89a7
1 zmienionych plików z 12 dodań i 9 usunięć

7
gui.js
Wyświetl plik

@ -5440,17 +5440,20 @@ ProjectDialogMorph.prototype.setSource = function (source) {
if (myself.task === 'open') { if (myself.task === 'open') {
src = localStorage['-snap-project-' + item.name]; src = localStorage['-snap-project-' + item.name];
if (src) {
xml = myself.ide.serializer.parse(src); xml = myself.ide.serializer.parse(src);
myself.notesText.text = xml.childNamed('notes').contents myself.notesText.text = xml.childNamed('notes').contents
|| ''; || '';
myself.notesText.drawNew(); myself.notesText.drawNew();
myself.notesField.contents.adjustBounds(); myself.notesField.contents.adjustBounds();
myself.preview.texture = xml.childNamed('thumbnail').contents myself.preview.texture =
|| null; xml.childNamed('thumbnail').contents || null;
myself.preview.cachedTexture = null; myself.preview.cachedTexture = null;
myself.preview.drawNew(); myself.preview.drawNew();
} }
}
myself.edit(); myself.edit();
}; };
} else { // 'examples'; 'cloud' is initialized elsewhere } else { // 'examples'; 'cloud' is initialized elsewhere