Fix NPE when interval has no tags

This commit is contained in:
Thomas Lauf 2018-09-18 20:51:14 +02:00
parent 3c0627166a
commit 0273987ae6

View file

@ -216,10 +216,13 @@ Interval Interval::fromJson (std::string jsonString)
json::array* tags = (json::array*) json->_data["tags"];
for (auto& tag : tags->_data)
if (tags != nullptr)
{
auto* value = (json::string*) tag;
interval.tag(value->_data);
for (auto& tag : tags->_data)
{
auto* value = (json::string*) tag;
interval.tag(value->_data);
}
}
json::string* start = (json::string*) json->_data["start"];