From 5dcc01317b91bf56c3206834a1915363b27ffde9 Mon Sep 17 00:00:00 2001 From: nestorrente Date: Mon, 14 Oct 2019 17:42:19 +0200 Subject: [PATCH] Added fix to prevent Gnome Shell crash while playing videos on Chromium/Chrome: https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1835623 --- src/streamMenu.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/streamMenu.js b/src/streamMenu.js index 76a6492..dbc40ae 100644 --- a/src/streamMenu.js +++ b/src/streamMenu.js @@ -841,12 +841,21 @@ var MPRISStream = new Lang.Class({ if('xesam:artist' in metaD){ let artists = metaD['xesam:artist']; - let str = artists.get_child_value(0).get_string()[0]; + let artistsType = artists.get_type(); - for(let i = 1; i < artists.n_children(); i++) - str += ', '+artists.get_child_value(i).get_string()[0]; + if(artistsType.is_array()) { + let str = artists.get_child_value(0).get_string()[0]; + + for(let i = 1; i < artists.n_children(); i++) + str += ', '+artists.get_child_value(i).get_string()[0]; + + this._artistLbl.text = str; + } else if(artistsType.is_basic()) { + this._artistLbl.text = artists.get_string()[0]; + } else { + this._artistLbl.text = 'Unknown artist'; + } - this._artistLbl.text = str; this._artistBox.show(); } else { this._artistBox.hide();