aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--circular_saw.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/circular_saw.lua b/circular_saw.lua
index b0a6d64..b0b039c 100644
--- a/circular_saw.lua
+++ b/circular_saw.lua
@@ -242,6 +242,9 @@ function circular_saw.allow_metadata_inventory_put(
local incost = (incount * 8) + microstack:get_count()
local maxcost = (stackmax * 8) + 7
local cost = circular_saw:get_cost(inv, stackname)
+ if not cost then
+ return 0
+ end
if (incost + cost) > maxcost then
return math.max((maxcost - incost) / cost, 0)
end