TypeError: 'NoneType' object has no attribute '__getitem__'

前端 未结 3 970
野趣味
野趣味 2020-12-05 18:02

I\'m having an issue and I have no idea why this is happening and how to fix it. I\'m working on developing a Videogame with python and pygame and I\'m getting this error: <

3条回答
  •  天涯浪人
    2020-12-05 18:26

    BrenBarn is correct. The error means you tried to do something like None[5]. In the backtrace, it says self.imageDef=self.values[2], which means that your self.values is None.

    You should go through all the functions that update self.values and make sure you account for all the corner cases.

提交回复
热议问题