From eb3680013eaede615111fe209ff9341a706b3983 Mon Sep 17 00:00:00 2001 From: Joseph Davies Date: Mon, 3 Nov 2014 09:32:09 -0800 Subject: [PATCH] Fix crash when user tries to add a clothing item which doesn't exist. We now check whether we got anything back from FindItemByName instead of just handing off an empty item to AddItemsToCloset. --- Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp index 12c9828c..9cf7e9f8 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp @@ -6515,7 +6515,10 @@ PF_CONSOLE_CMD( Clothing, // Group name items[0].fOptions.fTint1.Set(params[1], params[2], params[3], 1.f); items[0].fOptions.fTint2.Set(params[4], params[5], params[6], 1.f); - plClothingMgr::GetClothingMgr()->AddItemsToCloset(items); + if (items[0].fItem) + plClothingMgr::GetClothingMgr()->AddItemsToCloset(items); + else + PrintString("The specified clothing item could not be found."); } PF_CONSOLE_CMD( Clothing, // Group name