Don't crash when clicking on inexistent file
This commit is contained in:
parent
a3bc2be09b
commit
c5f47d55a6
|
@ -244,7 +244,7 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate, NSMenuDelegate, NSOpenSavePa
|
||||||
}
|
}
|
||||||
if let file = (selection as? ASFileItem) {
|
if let file = (selection as? ASFileItem) {
|
||||||
var enc : UInt = 0
|
var enc : UInt = 0
|
||||||
editor.setString(NSString(contentsOfURL:file.url, usedEncoding:&enc, error:nil) as! String)
|
editor.setString(NSString(contentsOfURL:file.url, usedEncoding:&enc, error:nil) as? String ?? "")
|
||||||
editor.setMode(UInt(file.type.aceMode))
|
editor.setMode(UInt(file.type.aceMode))
|
||||||
editor.alphaValue = 1.0
|
editor.alphaValue = 1.0
|
||||||
mainEditor = selection
|
mainEditor = selection
|
||||||
|
|
Loading…
Reference in New Issue
Block a user