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.

pull/2450/head
Matias 2019-05-09 11:19:05 +02:00
parent 9430696048
commit 6736f3d24b
1 changed files with 4 additions and 2 deletions

View File

@ -252,6 +252,7 @@ void FBX::Node::DumpChildren(
} else {
std::ostringstream ss;
DumpChildrenAscii(ss, indent);
if (ss.tellp() > 0)
s.PutString(ss.str());
}
}
@ -266,6 +267,7 @@ void FBX::Node::End(
} else {
std::ostringstream ss;
EndAscii(ss, indent, has_children);
if (ss.tellp() > 0)
s.PutString(ss.str());
}
}