It looks like CurrentNode is null. Are you not getting a NullPointerException on this line, just above the one you marked in comments?

System.out.println(CurrentNode.getData() + " ");
Your...