From 1ff7d54511cd7ec063bd8a87542cdc5bc25ad694 Mon Sep 17 00:00:00 2001 From: James Groom Date: Fri, 19 Apr 2024 00:03:30 +1000 Subject: [PATCH] Make Lua `onqueryitemtext` more resilient (resolves #3897) --- .../tools/Lua/Libraries/TAStudioLuaLibrary.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/TAStudioLuaLibrary.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/TAStudioLuaLibrary.cs index 8eb9527cd1..0f6eb5f053 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/TAStudioLuaLibrary.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/TAStudioLuaLibrary.cs @@ -511,11 +511,7 @@ namespace BizHawk.Client.EmuHawk { if (Engaged()) { - Tastudio.QueryItemTextCallback = (index, name) => - { - var result = luaf.Call(index, name); - return result?[0]?.ToString(); - }; + Tastudio.QueryItemTextCallback = (index, name) => luaf.Call(index, name)?.FirstOrDefault()?.ToString(); } }