From 2aec14931608457bdbbb5436170bb8523cb0c9fd Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 28 May 2015 13:33:38 -0700 Subject: [PATCH] check for existance of KEY_DOWNLOAD_STATE entry before trying to read its value --- extensions/assets-manager/Manifest.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/extensions/assets-manager/Manifest.cpp b/extensions/assets-manager/Manifest.cpp index d7541f7a2d..5d8dfa53a6 100644 --- a/extensions/assets-manager/Manifest.cpp +++ b/extensions/assets-manager/Manifest.cpp @@ -329,10 +329,9 @@ void Manifest::setAssetDownloadState(const std::string &key, const Manifest::Dow std::string jkey = itr->name.GetString(); if (jkey == key) { rapidjson::Value &entry = itr->value; - rapidjson::Value &value = entry[KEY_DOWNLOAD_STATE]; - if (value.IsInt()) + if (entry.HasMember(KEY_DOWNLOAD_STATE) && entry[KEY_DOWNLOAD_STATE].IsInt()) { - value.SetInt((int)state); + entry[KEY_DOWNLOAD_STATE].SetInt((int) state); } else {