From 6736f3d24b6c83389326207b704211696b0e8e2c Mon Sep 17 00:00:00 2001 From: Matias Date: Thu, 9 May 2019 11:19:05 +0200 Subject: [PATCH] Don't call PutString with an empty string. Both DumpChildrenAscii and EndAscii can return without modifyting the string, so we need to check the string before calling PutString. This used to cause a crash. --- code/FBXExportNode.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/FBXExportNode.cpp b/code/FBXExportNode.cpp index e5215466a..e90a50e67 100644 --- a/code/FBXExportNode.cpp +++ b/code/FBXExportNode.cpp @@ -252,7 +252,8 @@ void FBX::Node::DumpChildren( } else { std::ostringstream ss; DumpChildrenAscii(ss, indent); - s.PutString(ss.str()); + if (ss.tellp() > 0) + s.PutString(ss.str()); } } @@ -266,7 +267,8 @@ void FBX::Node::End( } else { std::ostringstream ss; EndAscii(ss, indent, has_children); - s.PutString(ss.str()); + if (ss.tellp() > 0) + s.PutString(ss.str()); } }