on xenial help sign in
Check if the appId string is not empty before using it
commit6c68e0cbe48ad1fdf2208679d67139588a351cd2 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateMon 2 Feb 2015, 17:28 (12 years ago) parenteb8eb74
1 file changed+7−5
qml/Stages/TabletStage.qml+7−5
qml/Stages/TabletStage.qml+7−5
@@ -82,11 +82,13 @@ Rectangle {
8282 }
8383
8484 function updateSpreadDelegateFocus() {
85− var focusedAppIndex = priv.indexOf(priv.focusedAppId);
86− if (focusedAppIndex !== -1) {
87− spreadRepeater.itemAt(focusedAppIndex).focus = true;
88− } else {
89− console.warn("TabletStage: Failed to find the SpreadDelegate for appID=" + priv.focusedAppId);
85+ if (priv.focusedAppId) {
86+ var focusedAppIndex = priv.indexOf(priv.focusedAppId);
87+ if (focusedAppIndex !== -1) {
88+ spreadRepeater.itemAt(focusedAppIndex).focus = true;
89+ } else {
90+ console.warn("TabletStage: Failed to find the SpreadDelegate for appID=" + priv.focusedAppId);
91+ }
9092 }
9193 }
9294