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ęć

21
gui.js
Wyświetl plik

@ -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();
};