Deal with non-optional Node.childNodes.

This commit is contained in:
Brent Simmons 2018-02-25 22:02:16 -08:00
parent 49059fe78e
commit fc38a485d6
3 changed files with 5 additions and 6 deletions

View File

@ -91,7 +91,7 @@ extension FeedListViewController: NSOutlineViewDataSource {
func outlineView(_ outlineView: NSOutlineView, child index: Int, ofItem item: Any?) -> Any {
return nodeForItem(item as AnyObject?).childNodes![index]
return nodeForItem(item as AnyObject?).childNodes[index]
}
func outlineView(_ outlineView: NSOutlineView, isItemExpandable item: Any) -> Bool {

View File

@ -147,9 +147,8 @@ private extension AddFeedWindowController {
menuItem.representedObject = folderTreeController.rootNode.representedObject
menu.addItem(menuItem)
if let childNodes = folderTreeController.rootNode.childNodes {
addFolderItemsToMenuWithNodes(menu: menu, nodes: childNodes, indentationLevel: 1)
}
let childNodes = folderTreeController.rootNode.childNodes
addFolderItemsToMenuWithNodes(menu: menu, nodes: childNodes, indentationLevel: 1)
return menu
}
@ -166,7 +165,7 @@ private extension AddFeedWindowController {
menu.addItem(menuItem)
if oneNode.numberOfChildNodes > 0 {
addFolderItemsToMenuWithNodes(menu: menu, nodes: oneNode.childNodes!, indentationLevel: indentationLevel + 1)
addFolderItemsToMenuWithNodes(menu: menu, nodes: oneNode.childNodes, indentationLevel: indentationLevel + 1)
}
}
}

View File

@ -28,7 +28,7 @@ import RSCore
func outlineView(_ outlineView: NSOutlineView, child index: Int, ofItem item: Any?) -> Any {
return nodeForItem(item as AnyObject?).childNodes![index]
return nodeForItem(item as AnyObject?).childNodes[index]
}
func outlineView(_ outlineView: NSOutlineView, isItemExpandable item: Any) -> Bool {