What security exception are there with == operator?
You shouldn't use == to compare strings.
You coud use a 'reversed' notation to avoid NPE, like: if(!"".equals(message)). I'll let you decide if it looks readable enough.
Writing err.equals("") || err.equals(null) won't guard you against a NPE.
First, you should always check for null first. If err is null then err.equals("") will throw a NPE.
Second, err.equals(null) is an incorrect way to do a null check. It will throw NPE if err is null. Also, a properly designed equals method (String class has one) will never return true for null argument. For a null check you have to use the == operator.