Catch NPE and ignore selected key