Skip to content

Commit cf3c932

Browse files
lleytonmmstick
authored andcommitted
fix: check if extension local schemas dir exists before use
1 parent aafc945 commit cf3c932

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/settings.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,11 @@ function settings_new_id(schema_id: string): Settings | null {
3232

3333
function settings_new_schema(schema: string): Settings {
3434
const GioSSS = Gio.SettingsSchemaSource;
35-
// const schemaDir = Me.dir.get_child('schemas');
35+
const schemaDir = Gio.File.new_for_path(get_current_path()).get_child('schemas');
3636

37-
// let schemaSource = schemaDir.query_exists(null)
38-
// ? GioSSS.new_from_directory(get_current_path(), GioSSS.get_default(), false)
39-
// : GioSSS.get_default();
40-
41-
// get_current_path()
42-
43-
let schemaSource = GioSSS.new_from_directory(`${get_current_path()}/schemas/`, GioSSS.get_default(), false);
37+
let schemaSource = schemaDir.query_exists(null)
38+
? GioSSS.new_from_directory(schemaDir.get_path(), GioSSS.get_default(), false)
39+
: GioSSS.get_default();
4440

4541
const schemaObj = schemaSource.lookup(schema, true);
4642

0 commit comments

Comments
 (0)