{"action":"closed","issue":{"url":"https://api.github.com/repos/zendesk/zendesk_sdk_ios/issues/243","repository_url":"https://api.github.com/repos/zendesk/zendesk_sdk_ios","labels_url":"https://api.github.com/repos/zendesk/zendesk_sdk_ios/issues/243/labels{/name}","comments_url":"https://api.github.com/repos/zendesk/zendesk_sdk_ios/issues/243/comments","events_url":"https://api.github.com/repos/zendesk/zendesk_sdk_ios/issues/243/events","html_url":"https://github.com/zendesk/zendesk_sdk_ios/issues/243","id":182637641,"number":243,"title":"Setting nil value for a dictionary at ZDKAnonymousIdentity#toJson call","user":{"login":"takkyun","id":1464708,"avatar_url":"https://avatars.githubusercontent.com/u/1464708?v=3","gravatar_id":"","url":"https://api.github.com/users/takkyun","html_url":"https://github.com/takkyun","followers_url":"https://api.github.com/users/takkyun/followers","following_url":"https://api.github.com/users/takkyun/following{/other_user}","gists_url":"https://api.github.com/users/takkyun/gists{/gist_id}","starred_url":"https://api.github.com/users/takkyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takkyun/subscriptions","organizations_url":"https://api.github.com/users/takkyun/orgs","repos_url":"https://api.github.com/users/takkyun/repos","events_url":"https://api.github.com/users/takkyun/events{/privacy}","received_events_url":"https://api.github.com/users/takkyun/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-12T21:22:44Z","updated_at":"2016-10-13T11:14:18Z","closed_at":"2016-10-13T11:14:17Z","body":"It's the same issue as https://github.com/zendesk/zendesk_sdk_ios/issues/183\r\n\r\n- SDK version: tested on 1.5.4.1 and 1.7.5.1\r\n- Xcode version: tested with 7.3.1 and 8.0\r\n- iOS or Simulator: both\r\n- iOS Version: tested on 9.3 and 10.0\r\n- Swift version: tested with objective-c code\r\n\r\nSteps to Reproduce:\r\n\r\nRun the following code:\r\n\r\n```\r\nZDKAnonymousIdentity *identity = [[ZDKAnonymousIdentity alloc] init];\r\nidentity.name = @\"123456789\";'\r\nidentity.email = @\"123456789@qq.com\";\r\nidentity.externalId = @\"123456789\";\r\nNSDictionary *dictionary = [identity toJson];\r\n```\r\n\r\nIt causes calling `setObject:forKey:` (`setObject:forKeyedSubscript:`) with `nil` value (`key` == `externalId`).\r\n\r\nThe return value of `toJson` is going to be if I've replaced `NSNull` instance when it happened:\r\n\r\n```\r\n{\r\n    email = \"123456789@qq.com\";\r\n    externalId = \"<null>\";\r\n    \"external_id\" = \"123456789\";\r\n    name = \"123456789\";\r\n    \"sdk_guid\" = \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX\";\r\n}\r\n```\r\n\r\nso SDK is using \"external_id\" instead of \"externalId\" but still try to set \"externalId\" with `nil` value.\r\n\r\nProbably it's guarded with runtime exception inside SDK, so app won't be crashed.\r\n"}}
{"actor":{"display_login":"RonanMcH"}}