diff --git a/ReallifeGamemode.Client/inventory/inventory.ts b/ReallifeGamemode.Client/inventory/inventory.ts index 846a062a..b02afda5 100644 --- a/ReallifeGamemode.Client/inventory/inventory.ts +++ b/ReallifeGamemode.Client/inventory/inventory.ts @@ -11,9 +11,12 @@ export default function inventory(globalData: GlobalData): void { mp.events.add("openTradeWindow", (money1, itemIdArr1, itemAmountArr1) => { if (!globalData.InMenu) { if (invBrowser !== null) { - invBrowser.destroy() - invBrowser = null; - mp.gui.cursor.show(false, false); + try { + invBrowser.destroy() + invBrowser = null; + } finally { + mp.gui.cursor.show(false, false); + } return; } mp.gui.cursor.show(true, true); @@ -29,9 +32,13 @@ export default function inventory(globalData: GlobalData): void { mp.events.add('inventoryShow', (itemIdArr1, itemAmountArr1) => { if (!globalData.InMenu) { if (invBrowser !== null) { - invBrowser.destroy() - invBrowser = null; - mp.gui.cursor.show(false, false); + try { + invBrowser.destroy() + invBrowser = null; + } + finally { + mp.gui.cursor.show(false, false); + } return; }