Incredibly annoying crashing, no console errors or wrong code.

I get crashing in my inventory script using scene.addObject()
I have now narrowed it down to the object not appearing the the scene list.
Why wouldn’t an object appear in a scene list? it’s on a hidden layer, but should appear in scene.objects.

The most useful thing would be to run blender in a debugger, and then try using the script. If it actually causes a crash, the debugger can tell you exactly where this crash is happening, which usually helps you figure out why it is happening. If you aren’t comfortable with building and debugging Blender, and if you don’t mind sharing the file, I could take a look at it.

I found the problem, addObject can’t find the objects, which it should be able to do! They’re on layer 2, which is normal for addobject funcitons, and was working before