File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ class GjsOskExtension {
187
187
this . Keyboard . destroy ( ) ;
188
188
this . Keyboard = null ;
189
189
}
190
- let [ ok , contents ] = GLib . file_get_contents ( GLib . get_user_cache_dir ( ) + '/gjs-osk/keycodes/' + KeyboardManager . getKeyboardManager ( ) . currentLayout . id + '.json' ) ;
190
+ let [ ok , contents ] = GLib . file_get_contents ( GLib . get_user_cache_dir ( ) + '/gjs-osk/keycodes/' + ( KeyboardManager . getKeyboardManager ( ) . currentLayout != null ? KeyboardManager . getKeyboardManager ( ) . currentLayout . id : "us" ) + '.json' ) ;
191
191
if ( ok ) {
192
192
keycodes = JSON . parse ( contents ) ;
193
193
}
@@ -225,7 +225,11 @@ class GjsOskExtension {
225
225
this . _toggleKeyboard ( ) ;
226
226
} )
227
227
let settingsChanged = ( ) => {
228
- let opened = this . Keyboard . opened
228
+ let opened ;
229
+ if ( this . Keyboard != null )
230
+ opened = this . Keyboard . opened
231
+ else
232
+ opened = false
229
233
if ( this . darkSchemeSettings . get_string ( "color-scheme" ) == "prefer-dark" )
230
234
this . settings . scheme = "-dark"
231
235
else
@@ -285,7 +289,8 @@ class GjsOskExtension {
285
289
this . _indicator . destroy ( ) ;
286
290
this . _indicator = null ;
287
291
}
288
- this . Keyboard . destroy ( ) ;
292
+ if ( this . Keyboard != null )
293
+ this . Keyboard . destroy ( ) ;
289
294
this . settings . disconnect ( this . settingsHandlers [ 0 ] ) ;
290
295
this . darkSchemeSettings . disconnect ( this . settingsHandlers [ 1 ] )
291
296
this . inputLanguageSettings . disconnect ( this . settingsHandlers [ 2 ] )
You can’t perform that action at this time.
0 commit comments