From 728511b137dcdeb5e940b14f092dae2d184b8036 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 23 Feb 2019 16:50:05 -0600 Subject: [PATCH] Sanity check so calling getFieldValue on a blank fieldName doesn't cause a crash. --- Engine/source/console/simObject.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 447d96ce4..28cbf1007 100644 --- a/Engine/source/console/simObject.cpp +++ b/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 ];