I made a maze game. When you click the button, a navigator is created. But before you create a navigator, if you try moving the navigator, there is a null pointer exception.
since the navigator can be moved by pressing keys on the keyboard, I want an error message to appear if and when user tries to move the navigator without creating a navigator.
i want to do
if nav==null //not created
error message
else
do...
how do i do this?