A common cause of this error is not declaring lists as global. Lists only persist as long as the variables referring to them persist. If a list is defined in a local variable, and the handler it was defined in finishes, the list gets cleared away. If you then try to use it again without redefining it, you get this error.