diff --git a/src/generators/Generator.js b/src/generators/Generator.js index ef5eda8d46..6737f1f99a 100644 --- a/src/generators/Generator.js +++ b/src/generators/Generator.js @@ -70,7 +70,7 @@ export default class Generator { else { // handle shorthand properties - if ( parent.type === 'Property' && parent.shorthand ) { + if ( parent && parent.type === 'Property' && parent.shorthand ) { if ( key === 'key' ) { code.appendLeft( node.start, `${name}: ` ); return;