{"action":"created","issue":{"url":"https://api.github.com/repos/bitstadium/HockeySDK-iOS/issues/228","labels_url":"https://api.github.com/repos/bitstadium/HockeySDK-iOS/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/bitstadium/HockeySDK-iOS/issues/228/comments","events_url":"https://api.github.com/repos/bitstadium/HockeySDK-iOS/issues/228/events","html_url":"https://github.com/bitstadium/HockeySDK-iOS/issues/228","id":117024961,"number":228,"title":"SDK will crash the app if hockey app id is nil or blank string","user":{"login":"zmian","id":621693,"avatar_url":"https://avatars.githubusercontent.com/u/621693?v=3","gravatar_id":"","url":"https://api.github.com/users/zmian","html_url":"https://github.com/zmian","followers_url":"https://api.github.com/users/zmian/followers","following_url":"https://api.github.com/users/zmian/following{/other_user}","gists_url":"https://api.github.com/users/zmian/gists{/gist_id}","starred_url":"https://api.github.com/users/zmian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmian/subscriptions","organizations_url":"https://api.github.com/users/zmian/orgs","repos_url":"https://api.github.com/users/zmian/repos","events_url":"https://api.github.com/users/zmian/events{/privacy}","received_events_url":"https://api.github.com/users/zmian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"lumaxis","id":406937,"avatar_url":"https://avatars.githubusercontent.com/u/406937?v=3","gravatar_id":"","url":"https://api.github.com/users/lumaxis","html_url":"https://github.com/lumaxis","followers_url":"https://api.github.com/users/lumaxis/followers","following_url":"https://api.github.com/users/lumaxis/following{/other_user}","gists_url":"https://api.github.com/users/lumaxis/gists{/gist_id}","starred_url":"https://api.github.com/users/lumaxis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lumaxis/subscriptions","organizations_url":"https://api.github.com/users/lumaxis/orgs","repos_url":"https://api.github.com/users/lumaxis/repos","events_url":"https://api.github.com/users/lumaxis/events{/privacy}","received_events_url":"https://api.github.com/users/lumaxis/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-11-15T22:51:38Z","updated_at":"2015-11-15T23:00:53Z","closed_at":null,"body":"```swift\r\nfunc setupHockeySDK() {\r\n    ...\r\n    BITHockeyManager.sharedHockeyManager().configureWithIdentifier(hockeyAppId)\r\n    ...\r\n}\r\n```\r\n\r\nAbove snippet will crash the app if `hockeyAppId` is `nil` or **blank** string with following: `Fatal error: unexpectedly found nil while unwrapping an Optional value`\r\n\r\nWorkaround is to add \r\n\r\n```swift\r\nfunc setupHockeySDK() {\r\n    guard let hockeyAppId = hockeyAppId else { return }\r\n    ...\r\n    BITHockeyManager.sharedHockeyManager().configureWithIdentifier(hockeyAppId)\r\n    ...\r\n}\r\n```\r\n\r\nWould it be possible to audit the api headers and add nullability audit checks. But would still require the api to check for blank strings\r\n```objc\r\nNS_ASSUME_NONNULL_BEGIN\r\nNS_ASSUME_NONNULL_END\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/bitstadium/HockeySDK-iOS/issues/comments/156867355","html_url":"https://github.com/bitstadium/HockeySDK-iOS/issues/228#issuecomment-156867355","issue_url":"https://api.github.com/repos/bitstadium/HockeySDK-iOS/issues/228","id":156867355,"user":{"login":"zmian","id":621693,"avatar_url":"https://avatars.githubusercontent.com/u/621693?v=3","gravatar_id":"","url":"https://api.github.com/users/zmian","html_url":"https://github.com/zmian","followers_url":"https://api.github.com/users/zmian/followers","following_url":"https://api.github.com/users/zmian/following{/other_user}","gists_url":"https://api.github.com/users/zmian/gists{/gist_id}","starred_url":"https://api.github.com/users/zmian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmian/subscriptions","organizations_url":"https://api.github.com/users/zmian/orgs","repos_url":"https://api.github.com/users/zmian/repos","events_url":"https://api.github.com/users/zmian/events{/privacy}","received_events_url":"https://api.github.com/users/zmian/received_events","type":"User","site_admin":false},"created_at":"2015-11-15T23:00:53Z","updated_at":"2015-11-15T23:00:53Z","body":"Thanks for quick reply.\r\n\r\nMake sense without identifier the SDK wouldn't work but it should't crash the app. Kinda meta... crash logger is crashing the app :D\r\n"}}