Skip to content
This repository has been archived by the owner on Sep 27, 2020. It is now read-only.

Commit

Permalink
[!] Check if there exists any profile before get selection from array…
Browse files Browse the repository at this point in the history
…Controller
  • Loading branch information
15cm committed Feb 7, 2017
1 parent 8f5a6c0 commit a5f67eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions AMM/Window/PreferencesWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ class PreferencesWindowController: NSWindowController, NSWindowDelegate {

// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
serverTableScrollView.borderType = .noBorder
// Init NSPopUpButton of protocols
protocolPopUpButton.addItems(withTitles: Aria2Protocols.allValues.map({$0.rawValue}))
let protocolOfSelection = (arrayController.selection as AnyObject).value(forKey: "protocolRawValue") as! String?
protocolPopUpButton.selectItem(withTitle: protocolOfSelection!)
if !profileManager.servers.isEmpty {
let protocolOfSelection = (arrayController.selection as AnyObject).value(forKey: "protocolRawValue") as! String?
protocolPopUpButton.selectItem(withTitle: protocolOfSelection!)
}
}

func reloadProfiles() {
Expand Down

0 comments on commit a5f67eb

Please sign in to comment.