When I compile the code, all is ok, but when i try to run it, it says everytime "java.lang.NullpointerException". Why?
it marked "if(mi.getActor()==start){"

1 2 3 4 5 6 | if (gamestatus== 1 ){ MouseInfo mi=Greenfoot.getMouseInfo(); if (mi.getActor()!= null ){ if (mi.getActor()==start) setImage( "Clear.png" ); } } |
1 2 3 4 | if (gamestatus== 1 ){ MouseInfo mi=Greenfoot.getMouseInfo(); if (mi.getActor()!= null && mi.getActor()==start) setImage( "Clear.png" ); } |
1 | if (mi.getActor()!= null ){ |
1 | if (mi != null ){ |