Skip to content

Commit

Permalink
fix crash problem
Browse files Browse the repository at this point in the history
  • Loading branch information
qinyuhang committed Oct 18, 2016
1 parent 8fa7f76 commit dd20ebd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ShadowsocksX-NG/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,14 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
showRunningModeMenuItem.state = defaults.bool(forKey: "ShowRunningModeOnStatusBar") ? 1 : 0

var serverMenuText = "Servers".localized
for v in defaults.array(forKey: "ServerProfiles")! {
let profile = v as! [String:Any]
if profile["Id"] as! String == defaults.string(forKey: "ActiveServerProfileId")! {
let mgr = ServerProfileManager.instance
for p in mgr.profiles {
if mgr.activeProfileId == p.uuid {
var profileName :String
if profile["Remark"] as! String != "" {
profileName = profile["Remark"] as! String
if !p.remark.isEmpty {
profileName = p.remark
} else {
profileName = profile["ServerHost"] as! String
profileName = p.serverHost
}
serverMenuText = "\(serverMenuText) - \(profileName)"
}
Expand Down

0 comments on commit dd20ebd

Please sign in to comment.