Check if key is nil - to fix the “EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0).” crash