Avoid NPE during JNDI lookup

JNDI lookup could return null