summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2022-02-21 20:31:39 +0200
committerMarius Vlad <marius.vlad@collabora.com>2022-02-22 13:27:30 +0200
commitc35327b02a28a83536450a664326d183662e89e1 (patch)
tree8b8af3fefbe7ba8c2fbb72e3b313e92dcb873fe0
parentb7b156ece9492401f7bfe7676e7521f4cdd32905 (diff)
homescreenhandler: Avoid passing an invalid appidmarlin_12.93.0marlin/12.93.012.93.0
If there's no item added in the QList we'll return an invalid value pointing to some invalid memory, which we can not determine if its empty string or not, so this makes sure we check the list itself. Found when looking at removal/activation of surfaces while re-doing some parts in the compositor. Bug-AGL: SPEC-4263 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I912aa5a42a7d21374a389a7f193979f30504a83b
-rw-r--r--homescreen/src/homescreenhandler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/homescreen/src/homescreenhandler.cpp b/homescreen/src/homescreenhandler.cpp
index 5ed1fab..c44cbb9 100644
--- a/homescreen/src/homescreenhandler.cpp
+++ b/homescreen/src/homescreenhandler.cpp
@@ -126,6 +126,7 @@ void HomescreenHandler::appTerminated(const QString& application_id)
HMI_DEBUG("HomeScreen", "Application %s terminated, activating last app", application_id.toStdString().c_str());
if (apps_stack.contains(application_id)) {
apps_stack.removeOne(application_id);
- appStarted(apps_stack.last());
+ if (!apps_stack.isEmpty())
+ appStarted(apps_stack.last());
}
}