diff --git a/Nodes.cpp b/Nodes.cpp index 755baa4..f74b5e9 100644 --- a/Nodes.cpp +++ b/Nodes.cpp @@ -111,12 +111,14 @@ void Branch::emit(std::ostream &stream, int indent) { } } - if (els != nullptr) { - stream << " else {\n"; - els->emit(stream, indent + 1); - emitIndent(stream, indent); - stream << "}"; + if (els == nullptr) { + return; } + + stream << " else {\n"; + els->emit(stream, indent + 1); + emitIndent(stream, indent); + stream << "}"; } void VarDeclaration::emit(std::ostream &stream, int indent) {