AppDisplay: fix isTerminal() check for apps without categories

If there is no Categories line in the .desktop file, get_categories()
returns null, not an empty array.
This commit is contained in:
Giovanni Campagna 2014-01-13 23:02:06 +01:00
parent d1c4e60636
commit a4e019442f

View File

@ -48,7 +48,8 @@ const PAGE_SWITCH_TRESHOLD = 0.2;
const PAGE_SWITCH_TIME = 0.3; const PAGE_SWITCH_TIME = 0.3;
function _isTerminal(app) { function _isTerminal(app) {
return app.get_app_info().get_categories().indexOf('TerminalEmulator') > -1; let categories = app.get_app_info().get_categories() || [];
return categories.indexOf('TerminalEmulator') > -1;
} }
// Recursively load a GMenuTreeDirectory; we could put this in ShellAppSystem too // Recursively load a GMenuTreeDirectory; we could put this in ShellAppSystem too