1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Tweaked handling of corrupted data in ValueTree::readFromStream

This commit is contained in:
jules 2015-04-20 18:06:10 +01:00
parent 1c382e83fc
commit 7037b7243e

View file

@ -1003,10 +1003,17 @@ ValueTree ValueTree::readFromStream (InputStream& input)
for (int i = 0; i < numProps; ++i)
{
const String name (input.readString());
jassert (name.isNotEmpty());
if (name.isNotEmpty())
{
const var value (var::readFromStream (input));
v.object->properties.set (name, value);
}
else
{
jassertfalse; // trying to read corrupted data!
}
}
const int numChildren = input.readCompressedInt();
v.object->children.ensureStorageAllocated (numChildren);