after much trial and error I've got the code to work but i don't understand why if the if statement is if (name == null || name.isEmpty()) the code works, but if it's if (name.isEmpty() || name == null) or if (name.isEmpty()) i get a nullpointerexception error