Struct error when packaging

Hello. I’m having a very weird problem that I just can’t seem to figure out how to fix.

When I try to package my project, the ouput log tells me something about “Ensure condition failed: DefaultStructInstance.IsValid()” I’m not sure what it means. There are no issues compiling all my blueprints and everything works perfectly while playing the game but as soon as I start packaging it, it ends up with this error.

I attached the log file bellow. Please help me!



Hello Measuring,

As this is an ensure, you wouldn’t normally see these while using the editor until you either run the project in debug from Visual Studio, try to package, or happen to be looking at the output log when they occur. Ensures are close to Asserts (which cause crashes) that are bad but are able to be handled by the editor and can let the process continue as usual. They are fatal when packaging however.

This particular ensure is being triggered due to the IsValid check failing on a particular struct. It seems that it may be something to do with your InventoryComponent. This is mentioned at the end of the callstack:

LogBlueprint:Warning: [Compiler InventoryComponent] Warning MakeStructureDefaultValue parsing error. Object: Default__InventoryComponent_C, Property: Inventory

Can you check on any structs related to this component and see if there are any problems where there could be a null reference of some sort?

Hello Matthew! And thank you for replying!

I did use IsValid once but it was remove quite a while ago. I also made sure to search every blueprint for “valid” but none of them gave me any results… What else could be causing this? I find it really hard to understand the meaning of the logs sometimes and this time I am completely lost. I know that it seem to have something to do with a structure in my InventoryComponent but I can’t see anything odd or wrong about it…

Thanks again for the reply!

This isn’t going to be one of your IsValid nodes failing, the IsValid that is causing this ensure is likely part of another node that you’re using in your blueprint. If you have an idea as to which blueprint the issue may be in, you could place break points on your blueprint nodes and step through it as it executes, watching the output log to see if the ensure appears at any point.

Here’s a general guide on how to debug in blueprints:

We haven’t heard from you in a while, Measuring. Are you still experiencing this issue? If so, have you tried debugging the blueprint to find where the issue is? In the meantime, I’ll be marking this issue as resolved for tracking purposes.