Add null check on context switch 77/316177/1
authorYoungsun Suh <youngsun.suh@samsung.com>
Wed, 11 Dec 2024 07:31:06 +0000 (16:31 +0900)
committerYoungsun Suh <youngsun.suh@samsung.com>
Wed, 11 Dec 2024 08:06:02 +0000 (17:06 +0900)
Change-Id: I7daa865948ce6e468d21898c1f45f2a9babd4dfa

src/flat_navi.c

index 105ef39109f539489f935e00df1ce0f25c0e8f14..48d699e16e9ed118468f1343d5314399a01d7409 100644 (file)
@@ -344,9 +344,16 @@ void flat_navi_fallback_to_loop_in_same_root(FlatNaviContext *ctx)
 
 void flat_navi_context_root_change(FlatNaviContext *ctx, AtspiAccessible *root)
 {
+       if (!ctx || !root) {
+               DEBUG("No context or root!");
+               return;
+       }
+
        gchar *id = atspi_accessible_get_unique_id(root, NULL);
-       DEBUG("START - context root is changed to %s", id);
-       g_free(id);
+       if (id) {
+               DEBUG("START - context root is changed to %s", id);
+               g_free(id);
+       }
        g_clear_object(&ctx->root);
        ctx->root = root ? g_object_ref(root) : NULL;
 }