We should add a nil check for `key` and `value` with this change since `setObject:forKey:` raises an invalid argument exception if either are nil.