Fix FTBFS and crash triggered by <AppSystem>.load_from_desktop_file()
- Avoid error '"iconname" may be used uninitialized in this function' by initializing said variable to NULL. - Define shell_util_get_file_description as static (like the other similar functions) to avoid another compiler error. - Don't save errors from g_key_file_load_from_data_dirs into the variable "error" (ie. pass NULL to it instead). Without this, gnome-shell crashes if the key file can't be found (with message "Error invoking Shell.load_from_desktop_file: Valid key file could not be found in search dirs"). - Check the result of the load_from_desktop_file() call in places.js, as it may be null.
This commit is contained in:
@ -66,12 +66,14 @@ Places.prototype = {
|
||||
this._menuBox.append(home.actor, Big.BoxPackFlags.NONE);
|
||||
|
||||
let networkApp = Shell.AppSystem.get_default().load_from_desktop_file('gnome-network-scheme.desktop');
|
||||
let networkIcon = networkApp.create_icon_texture(PLACES_ICON_SIZE);
|
||||
let network = new PlaceDisplay(networkApp.get_name(), networkIcon, Lang.bind(this, function () {
|
||||
Main.overlay.hide();
|
||||
networkApp.launch();
|
||||
}));
|
||||
this._menuBox.append(network.actor, Big.BoxPackFlags.NONE);
|
||||
if (networkApp != null) {
|
||||
let networkIcon = networkApp.create_icon_texture(PLACES_ICON_SIZE);
|
||||
let network = new PlaceDisplay(networkApp.get_name(), networkIcon, Lang.bind(this, function () {
|
||||
Main.overlay.hide();
|
||||
networkApp.launch();
|
||||
}));
|
||||
this._menuBox.append(network.actor, Big.BoxPackFlags.NONE);
|
||||
}
|
||||
|
||||
let connectIcon = Shell.TextureCache.get_default().load_icon_name("applications-internet", PLACES_ICON_SIZE);
|
||||
let connect = new PlaceDisplay('Connect to...', connectIcon, Lang.bind(this, function () {
|
||||
|
Reference in New Issue
Block a user