Skip to content

Commit

Permalink
#5440: Fix exception on writing layer mappings of an empty map to the…
Browse files Browse the repository at this point in the history
… .darkradiant file
  • Loading branch information
codereader committed Dec 19, 2020
1 parent 8b74197 commit 2bd99ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion radiantcore/layers/LayerInfoFileModule.cpp
Expand Up @@ -114,7 +114,10 @@ void LayerInfoFileModule::writeBlocks(std::ostream& stream)
stream << "\t{" << std::endl;

// Write the output buffer to the stream
stream << _output.rdbuf();
if (_output.tellp() > 0)
{
stream << _output.rdbuf();
}

// Closing braces of NodeToLayerMapping block
stream << "\t}" << std::endl;
Expand Down

0 comments on commit 2bd99ba

Please sign in to comment.