Catch the NPE and set null - problem solved