From efc88c3f9a3249c09058606452218de8c776b74e Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Sat, 2 May 2015 20:17:58 +0100 Subject: [PATCH] fixed a crash in Repo parsing --- BuildaGitServer/Repo.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BuildaGitServer/Repo.swift b/BuildaGitServer/Repo.swift index e8f0da3..0c39036 100644 --- a/BuildaGitServer/Repo.swift +++ b/BuildaGitServer/Repo.swift @@ -22,7 +22,12 @@ public class Repo : GitHubEntity { self.fullName = json.stringForKey("full_name") self.repoUrlHTTPS = json.stringForKey("clone_url") self.repoUrlSSH = json.stringForKey("ssh_url") - self.permissions = json.dictionaryForKey("permissions") + + if let permissions = json.optionalDictionaryForKey("permissions") { + self.permissions = permissions + } else { + self.permissions = NSDictionary() + } super.init(json: json) }