Detect NullPointerException case and gracefully report it