elm_config: Null-check _elm_atspi_bridge_get() 64/283064/2 accepted/tizen/unified/20221102.020528
authorArtur Świgoń <a.swigon@samsung.com>
Mon, 17 Oct 2022 10:56:08 +0000 (12:56 +0200)
committerLukasz Oleksak <l.oleksak@samsung.com>
Thu, 27 Oct 2022 10:43:10 +0000 (10:43 +0000)
Usually the return value of _elm_atspi_bridge_get() is immediately
null-checked, including before elm_obj_atspi_bridge_connected_get(),
and so should be the case here in _elm_config_atspi_mode_set().

@tizen_only

Change-Id: Ia6c8a542e4c8115aefc041d03290aeaf4f63c3ee

src/lib/elementary/elm_config.c

index 5d50414..adcbe3f 100644 (file)
@@ -1148,8 +1148,11 @@ static void _elm_config_atspi_mode_set(Eina_Bool is_enabled)
    _elm_config->priv.atspi_mode = EINA_TRUE;
    is_enabled = !!is_enabled;
    // TIZEN_ONLY(20160721): enable atspi bridge on background apps
+   Eo *bridge = _elm_atspi_bridge_get();
    Eina_Bool connected = EINA_FALSE;
-   connected = elm_obj_atspi_bridge_connected_get(_elm_atspi_bridge_get());
+   if (bridge)
+     connected = elm_obj_atspi_bridge_connected_get(bridge);
+
    if ((_elm_config->atspi_mode == is_enabled) && (connected == is_enabled)) return;
    //
    _elm_config->atspi_mode = is_enabled;