Add null check on context switch 70/316170/1 accepted/tizen/7.0/unified/20241211.145241
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 07:31:06 +0000 (16:31 +0900)
Change-Id: I7daa865948ce6e468d21898c1f45f2a9babd4dfa

src/flat_navi.c

index 98648fe306ac1329d82f11c4c4823d66b65aa550..24038e87303ed9837759b9acd5fb96d930a645e6 100644 (file)
@@ -466,9 +466,17 @@ int flat_navi_context_setup(FlatNaviContext *ctx, AtspiAccessible *root)
 
 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);
+       }
+
        if (ctx->root) g_object_unref(ctx->root);
        ctx->root = root;
        if (ctx->root) g_object_ref(ctx->root);