Add early exit for non-existent block

This commit is contained in:
Katie Broida 2019-01-15 10:58:06 -05:00
parent 8b2f326469
commit 8256b3d5c5

View file

@ -990,6 +990,10 @@ class Blocks {
*/
blockToXML (blockId, comments) {
const block = this._blocks[blockId];
// block should exist, but currently some blocks' next property point
// to a blockId for non-existent blocks. Until we track down that behavior,
// this early exit allows the project to load.
if (!block) return;
// Encode properties of this block.
const tagName = (block.shadow) ? 'shadow' : 'block';
let xmlString =