Browse Source

Merge remote-tracking branch 'ombre5733/fix-rapidjson-usage'

Lasse Öörni 8 years ago
parent
commit
afc5618d5e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Source/Urho3D/Resource/JSONFile.cpp

+ 2 - 2
Source/Urho3D/Resource/JSONFile.cpp

@@ -186,8 +186,8 @@ static void ToRapidjsonValue(rapidjson::Value& rapidjsonValue, const JSONValue&
             for (unsigned i = 0; i < jsonArray.Size(); ++i)
             for (unsigned i = 0; i < jsonArray.Size(); ++i)
             {
             {
                 rapidjson::Value value;
                 rapidjson::Value value;
+                ToRapidjsonValue(value, jsonArray[i], allocator);
                 rapidjsonValue.PushBack(value, allocator);
                 rapidjsonValue.PushBack(value, allocator);
-                ToRapidjsonValue(rapidjsonValue[i], jsonArray[i], allocator);
             }
             }
         }
         }
         break;
         break;
@@ -201,8 +201,8 @@ static void ToRapidjsonValue(rapidjson::Value& rapidjsonValue, const JSONValue&
             {
             {
                 const char* name = i->first_.CString();
                 const char* name = i->first_.CString();
                 rapidjson::Value value;
                 rapidjson::Value value;
+                ToRapidjsonValue(value, i->second_, allocator);
                 rapidjsonValue.AddMember(name, value, allocator);
                 rapidjsonValue.AddMember(name, value, allocator);
-                ToRapidjsonValue(rapidjsonValue[name], i->second_, allocator);
             }
             }
         }
         }
         break;
         break;