Prevent a null pointer exception