diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm
index 5068e0806e3..f6b33f7326c 100644
--- a/code/datums/components/storage/storage.dm
+++ b/code/datums/components/storage/storage.dm
@@ -614,6 +614,11 @@
if(!stop_messages)
to_chat(M, "[I] is too big for [host]!")
return FALSE
+ var/datum/component/storage/biggerfish = real_location.loc.GetComponent(/datum/component/storage)
+ if(biggerfish && biggerfish.max_w_class < max_w_class)//return false if we are inside of another container, and that container has a smaller max_w_class than us (like if we're a bag in a box)
+ if(!stop_messages)
+ to_chat(M, "[I] can't fit in [host] while [real_location.loc] is in the way!")
+ return FALSE
var/sum_w_class = I.w_class
for(var/obj/item/_I in real_location)
sum_w_class += _I.w_class //Adds up the combined w_classes which will be in the storage item if the item is added to it.