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.

This commit is contained in:
Matias
2019-05-09 11:19:05 +02:00
parent 9430696048
commit 6736f3d24b

View File

@@ -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());
}
}