From 3847492f56b632153bce37281afc7c5b5b8629c1 Mon Sep 17 00:00:00 2001 From: bgkillas Date: Thu, 19 Sep 2024 09:39:28 -0400 Subject: [PATCH] fix an odd notplayer crash --- quant.ew/files/system/notplayer_ai/notplayer_ai.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quant.ew/files/system/notplayer_ai/notplayer_ai.lua b/quant.ew/files/system/notplayer_ai/notplayer_ai.lua index dbdad7d8..24acc5e9 100644 --- a/quant.ew/files/system/notplayer_ai/notplayer_ai.lua +++ b/quant.ew/files/system/notplayer_ai/notplayer_ai.lua @@ -81,7 +81,7 @@ local function get_potions_of_type(type) local mat = EntityGetFirstComponent(item, "MaterialInventoryComponent") local materials = ComponentGetValue2(mat, "count_per_material_type") local total = 0 - for id, amt in pairs(materials) do + for id, amt in pairs(materials or {}) do if amt ~= 0 then local name = CellFactory_GetName(id - 1) local use = false