@@ -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