fix crash if class is 0x0

if class is null, have `'NSInvalidArgumentException', reason: '*** setObjectForKey: key cannot be nil'`