diff --git a/src/models/applications.js b/src/models/applications.js index be44411b..1207266a 100644 --- a/src/models/applications.js +++ b/src/models/applications.js @@ -47,10 +47,14 @@ var FlatpakApplicationsModel = GObject.registerClass({ this._getInstallationsPaths().forEach(path => { const file = Gio.File.new_for_path(GLib.build_filenamev([path, 'app'])); - const monitor = file.monitor_directory(Gio.FileMonitorFlags.NONE, null); - monitor.connect('changed', this._changedDelayed.bind(this)); - this._monitors.push(monitor); + try { + const monitor = file.monitor_directory(Gio.FileMonitorFlags.NONE, null); + monitor.connect('changed', this._changedDelayed.bind(this)); + this._monitors.push(monitor); + } catch (err) { + logError(err); + } }); } diff --git a/src/models/permissions.js b/src/models/permissions.js index 5edfcc21..d7154862 100644 --- a/src/models/permissions.js +++ b/src/models/permissions.js @@ -309,9 +309,14 @@ var FlatpakPermissionsModel = GObject.registerClass({ paths.forEach(path => { const file = Gio.File.new_for_path(path); - const monitor = file.monitor_file(Gio.FileMonitorFlags.WATCH_MOVES, null); - monitor.connect('changed', this._delayMonitorsChanged.bind(this)); - this._monitors.push(monitor); + + try { + const monitor = file.monitor_file(Gio.FileMonitorFlags.WATCH_MOVES, null); + monitor.connect('changed', this._delayMonitorsChanged.bind(this)); + this._monitors.push(monitor); + } catch (err) { + logError(err); + } }); }