fixes a null material runtime (#20491)

This commit is contained in:
GDN
2023-03-08 13:15:28 -06:00
committed by GitHub
parent 626d2754d5
commit afd7c963dc
@@ -319,6 +319,8 @@
/datum/component/material_container/proc/get_item_material_amount(obj/item/I)
if(!istype(I))
return FALSE
if(!I.materials) // some objects have no materials and this will cause runtimes without this check
return 0
var/material_amount = 0
for(var/MAT in materials)
material_amount += I.materials[MAT]