Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

"Cannot read property 'next' of null"? what is that!? (Solved)


So I typed in this code and got this error and I don’t know what is happening I have never gotten this error before! Please help

And I am doing this in

And I know that I have the flag thing that lets you do it.


is that all the code you have?

i’m especially interested in the part of the code where you call your function flag(), if that exists.

I’m not quite sure if i can help you here, but maybe a bit more information could help.


This is where I call my code



hmm, i honestly have no clue why it comes up with that error then. Hope someone else knows.


Looks like the line self.pickUpFlag(flag) should be indented one level further, otherwise it will run regardless of the if check.


i noticed that too, but i don’t think that produces the error on line 12.


It doesn’t sorry but I tried that it so weird this is the first time I have gotten this so I don’t understand.


Could anyone find what

Cannot read property ‘next’ of null"

means or tell me because I don’t know


It looks like an error in the game engine (more specifically, the interpreter). Please post your entire code here so that developers will be able to test and discover why your code is triggering that game error.


We recently changed things to use hero instead of self. Seems likely that your hero() function is conflicting with that. Try renaming it?

1 Like

def coin():
coins = self.findItems()
coin = self.findNearest(coins)
if coin:

def flag():
flag1 = self.findFlag()
if flag1:

def hero():
enemies = self.findEnemies()
enemy = self.findNearest(enemies)
for enemy in enemies:
if enemy:
dis = self.distanceTo(enemy)
if dis < 5:
if self.isReady(“mana-blast”):
if enemy:
if self.isReady(“chain-lightning”):
self.cast(“chain-lightning”, enemy)
if < 300 and self.isReady(“regen”):
self.cast(“regen”, self)

def summon():
if self.isReady(“summon-burl”):


here is my code


I don’t see the null thing but now I get this and I didn’t get this before this is the same code as before.


You do not have boots with the move property equipped.

What boots are you wearing?


Have the white ones


Softened Leather Boots only has moveXY, but not move.


OH ok thanks and now is problem is sloved