Buggy code:
public class Subject { private List < Integer > subjWalkBitInt ; private int subjStandBitInt ; private int direction = 0 ; private float xPos = ( ( float ) ( ( GlobalInformation . getScreenWidth ( ) ) * 0.5 ) ) ; private float yPos = ( ( float ) ( ( GlobalInformation . getScreenHeight ( ) ) * 0.3 ) ) ; private float xDest = xPos ; private int destRoomID ; private Dijkstra dijkstra ; private List < Room > route ; private int routeRoomNum = 0 ; private Intelligence intel ; private Sound sound ; public Subject ( Context ctx ) { } private void fillWalkingIntegerLists ( ) { } public void tick ( ) { intel . tick ( ) ; int lower = GlobalInformation . getCurrentRoom ( ) ; int upper = GlobalInformation . getCurrentRoom ( ) ; int left = GlobalInformation . getCurrentRoom ( ) ; int right = GlobalInformation . getCurrentRoom ( ) ; try { lower = World . getRoomById ( GlobalInformation . getCurrentRoom ( ) ) . getLowerRoomID ( ) ; upper = World . getRoomById ( GlobalInformation . getCurrentRoom ( ) ) . getUpperRoomID ( ) ; left = World . getRoomById ( GlobalInformation . getCurrentRoom ( ) ) . getLeftRoomID ( ) ; right = World . getRoomById ( GlobalInformation . getCurrentRoom ( ) ) . getRightRoomID ( ) ; } catch ( NullPointerException e ) { e . printStackTrace ( ) ; } if ( ( ( xPos ) == ( xDest ) ) && ( ( GlobalInformation . getCurrentRoom ( ) ) == ( destRoomID ) ) ) { routeRoomNum = 0 ; SubjectMoveAction nextAction = intel . getNextAction ( ) ; setDest ( nextAction . getDestX ( ) , nextAction . getDestRoom ( ) ) ; <START_BUG> route = dijkstra . dijkstra ( World . getRoomByIdJS ( GlobalInformation . getCurrentRoom ( ) ) , World . getRoomByIdJS ( destRoomID ) ) ; <END_BUG> } else if ( ( GlobalInformation . getCurrentRoom ( ) ) == ( destRoomID ) ) { if ( ( xPos ) > ( xDest ) ) { direction = - 1 ; ( xPos ) -- ; } else { direction = 1 ; ( xPos ) ++ ; } } else if ( ( GlobalInformation . getCurrentRoom ( ) ) != ( destRoomID ) ) { if ( ( xPos ) == 0 ) { ( routeRoomNum ) ++ ; GlobalInformation . setCurrentRoom ( route . get ( routeRoomNum ) . getID ( ) ) ; xPos = ( GlobalInformation . getScreenWidth ( ) ) - 1 ; } else if ( ( xPos ) == ( GlobalInformation . getScreenWidth ( ) ) ) { ( routeRoomNum ) ++ ; GlobalInformation . setCurrentRoom ( route . get ( routeRoomNum ) . getID ( ) ) ; xPos = 1 ; } else if ( ( ( xPos ) == ( GlobalInformation . getScreenWidth ( ) ) ) && ( ( ( route . get ( ( ( routeRoomNum ) + 1 ) ) . getID ( ) ) == lower ) || ( ( route . get ( ( ( routeRoomNum ) + 1 ) ) . getID ( ) ) == upper ) ) ) { ( routeRoomNum ) ++ ; GlobalInformation . setCurrentRoom ( route . get ( routeRoomNum ) . getID ( ) ) ; xPos = 1 ; } else { if ( ( route . get ( ( ( routeRoomNum ) + 1 ) ) . getID ( ) ) == right ) { direction = 1 ; ( xPos ) ++ ; } else if ( ( route . get ( ( ( routeRoomNum ) + 1 ) ) . getID ( ) ) == left ) { direction = - 1 ; ( xPos ) -- ; } } } } private void setDest ( float x , int room ) { } public List < Integer > getPictureWalkID ( ) { } public int getPictureStandID ( ) { } public int getDirection ( ) { } public float getXPos ( ) { } public float getYPos ( ) { } }

Fix:
route = dijkstra . dijkstra ( World . getRoomById ( GlobalInformation . getCurrentRoom ( ) ) , World . getRoomById ( destRoomID ) ) ;