I'm trying to write a maze passage, but when I run it, the pass code falls into a NullPointerException. The labyrinth itself in the console is displayed without problems. Error refers to this section of code:
public boolean nearExit() { Integer[] temp = new Integer[2]; temp = path.peek(); if (temp[1] == searchRoute[0].length - 2) { if (searchRoute[temp[0] + 1][temp[1]] == 'X') { return true; } } return false; } All code here: https://github.com/kozloff13/MazeNavigator
It is important that if it is impossible to build a route, null will be returned to the console.