Skip to content

Commit

Permalink
fix: bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
gbammc committed Sep 30, 2016
1 parent 7cbcdbe commit 7338742
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Thor/AppModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ class AppModel: Equatable {

var icon: NSImage? {
get {
let bundle = Bundle(url: appBundleURL)!
guard let bundle = Bundle(url: appBundleURL) else {
return nil
}

let compositeName = "\(bundle.bundleIdentifier):\(appIconName)"
if let file = bundle.pathForImageResource(appIconName), let bundleImage = NSImage(contentsOfFile: file) {
bundleImage.setName(compositeName)
bundleImage.size = NSSize(width: 36, height: 36)
return bundleImage

guard let file = bundle.pathForImageResource(appIconName), let bundleImage = NSImage(contentsOfFile: file) else {
return nil
}

return nil
bundleImage.setName(compositeName)
bundleImage.size = NSSize(width: 36, height: 36)

return bundleImage
}
}

Expand Down

0 comments on commit 7338742

Please sign in to comment.