Skip to content

Commit 47f4d28

Browse files
committed
fix: correct try?/?? operator precedence in legacy config fallback
try? Data(contentsOf: a) ?? Data(contentsOf: b) is parsed as try? (Data(...) ?? Data(...)), so the fallback never fires. Use explicit parentheses: (try? Data(...)) ?? (try? Data(...))
1 parent 0fb2299 commit 47f4d28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CLI/cmux.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10721,7 +10721,7 @@ struct CMUXCLI {
1072110721
// Check if user has a config we symlinked, read from source (new name first, fall back to legacy)
1072210722
let userOmoConfig = userDir.appendingPathComponent("oh-my-openagent.json")
1072310723
let legacyOmoConfig = userDir.appendingPathComponent("oh-my-opencode.json")
10724-
let userConfigData = try? Data(contentsOf: userOmoConfig) ?? Data(contentsOf: legacyOmoConfig)
10724+
let userConfigData = (try? Data(contentsOf: userOmoConfig)) ?? (try? Data(contentsOf: legacyOmoConfig))
1072510725
if let data = userConfigData,
1072610726
let existing = try? JSONSerialization.jsonObject(with: data) as? [String: Any] {
1072710727
omoConfig = existing

0 commit comments

Comments
 (0)