Browse Source

Sanity check so calling getFieldValue on a blank fieldName doesn't cause a crash.

Areloch 6 năm trước cách đây
mục cha
commit
728511b137
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      Engine/source/console/simObject.cpp

+ 3 - 0
Engine/source/console/simObject.cpp

@@ -2834,6 +2834,9 @@ DefineEngineMethod( SimObject, getFieldValue, const char*, ( const char* fieldNa
    "@param index Optional parameter to specify the index of an array field separately.\n"
    "@return The value of the given field or \"\" if undefined." )
 {
+   if (fieldName == "")
+      return "";
+
    char fieldNameBuffer[ 1024 ];
    char arrayIndexBuffer[ 64 ];