PlacesMenu: don't fail for GIO errors getting the file name

Different GIO backends can fail in different ways trying to query
file infos. If that's the case, fail back to safe get_basename()
instead of crashing.
This commit is contained in:
Giovanni Campagna
2012-11-07 17:43:46 +01:00
parent 6833713da0
commit 5673baa6b5
+1 -1
View File
@@ -75,7 +75,7 @@ const PlaceInfo = new Lang.Class({
try {
let info = this.file.query_info('standard::display-name', 0, null);
return info.get_display_name();
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_SUPPORTED)) {
} catch(e if e instanceof Gio.IOErrorEnum) {
return this.file.get_basename();
}
},