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


#1

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.


#2

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.


#3

This is where I call my code

:grin:


#4

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


#5

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


#6

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


#7

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.


#8

Could anyone find what

Cannot read property ‘next’ of null"

means or tell me because I don’t know


#9

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.


#10

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


#11

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

def flag():
flag1 = self.findFlag()
if flag1:
self.pickUpFlag(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”):
self.cast(“mana-blast”)
if enemy:
if self.isReady(“chain-lightning”):
self.cast(“chain-lightning”, enemy)
if self.health < 300 and self.isReady(“regen”):
self.cast(“regen”, self)

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

loop:
flag()
summon()
hero()
coin()

here is my code


#12

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.


#13

You do not have boots with the move property equipped.

What boots are you wearing?


#14

Have the white ones


#15

Softened Leather Boots only has moveXY, but not move.


#16

OH ok thanks and now is problem is sloved