ID:2304530
 
Code:


Problem description:I'm not even going to post all the code that could be causing this, because it doesn't happen all the time, and there are probably 100 places that could be the cause. This was going on for a long time, causing problems, and there was no way to even know why it was happening until I decided to use a savefile editor on one of the same files, and sure enough, there it was, null was in several of my test characters list variables.

Has anybody ever had this problem, or have any idea how it gets there? If an object in a list is deleted, does null remain in the list? Or could it be when an variable that is set to null is added to a list? I don't know that either of these things are definatly happening, but I know its in there.

To fix this I guess I could randomly loop through all list variables of all players every 10 or 15 seconds and remove null from the list if thats even posible. If that is posible how would I go about doing it?

LawnMower wrote:
If an object in a list is deleted, does null remain in the list?

yes
What exactly causes the error "list index out of bounds"? It seems like this is caused by the null objects in the list, or if something is trying to read something at a place in the list that is longer than the list itself. I don't know for sure though, and its really throwing me for a loop. I don't know what to do about it, its making me feel like such a noob, even though I have been programming for a while now.
list index out of bounds means that you are trying to access something below 1 or beyond list.len

Login to reply.