Fixed potential NPE in robot update.

This commit is contained in:
Florian Nücke 2015-02-27 12:55:16 +01:00
parent 4ceb63e5fb
commit 56184a210a

View File

@ -121,7 +121,7 @@ object EventHandler {
val invalid = mutable.ArrayBuffer.empty[Robot]
runningRobots.foreach(robot => {
if (robot.isInvalid) invalid += robot
else robot.machine.update()
else if (robot.world != null) robot.machine.update()
})
runningRobots --= invalid
}