Merge pull request from ktbee/missing-block-early-exit

Add early exit for non-existent block
This commit is contained in:
Karishma Chadha 2019-01-15 11:29:40 -05:00 committed by GitHub
commit d5c2991a25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 =