mirror of https://github.com/axmolengine/axmol.git
check for existance of KEY_DOWNLOAD_STATE entry before trying to read its value
This commit is contained in:
parent
736de4e37c
commit
2aec149316
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue