Protect code against NPE