File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ struct Config: Codable {
13
13
var APIVersion : String ?
14
14
var Clusters : [ ClusterElement ]
15
15
var Contexts : [ ContextElement ]
16
- var CurrentContext : String
16
+ var CurrentContext : String ?
17
17
var Extensions : [ String : String ] ?
18
18
var Kind : String ?
19
19
var Preferences : Preferences ?
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ let contextChangedCallback: (EonilFSEventsEvent) -> () = {_ in
28
28
}
29
29
30
30
func showContextName( ) throws {
31
- let currContext : String = try ( k8s. getConfig ( ) ? . CurrentContext) !
31
+ let currContext : String = try ( k8s. getConfig ( ) ? . CurrentContext) ?? " "
32
32
if k8s. shouldShowContextName {
33
33
statusBarButton. title = currContext. truncated ( limit: 20 , position: String . TruncationPosition. middle, leader: " ... " )
34
34
} else {
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ class MenuManager: NSObject, NSMenuDelegate {
145
145
146
146
let currentContextTextItem = NSMenuItem ( title: " " , action: #selector( logClick ( _: ) ) , keyEquivalent: " " )
147
147
currentContextTextItem. target = self
148
- let currentContextText = NSAttributedString . init ( string: currentContext. wrap ( limit: 32 ) , attributes: [ NSAttributedString . Key. paragraphStyle: centerParagraphStyle] )
148
+ let currentContextText = NSAttributedString . init ( string: currentContext? . wrap ( limit: 32 ) ?? " " , attributes: [ NSAttributedString . Key. paragraphStyle: centerParagraphStyle] )
149
149
currentContextTextItem. attributedTitle = currentContextText
150
150
menu. addItem ( currentContextTextItem)
151
151
You can’t perform that action at this time.
0 commit comments