Add missing code to find type handle 68/140668/2 accepted/tizen/3.0/common/20170728.153313 accepted/tizen/3.0/common/20170728.153435 accepted/tizen/3.0/ivi/20170728.004838 accepted/tizen/3.0/ivi/20170728.005003 accepted/tizen/3.0/mobile/20170728.004753 accepted/tizen/3.0/mobile/20170728.004930 accepted/tizen/3.0/tv/20170728.004808 accepted/tizen/3.0/tv/20170728.004941 accepted/tizen/3.0/wearable/20170728.004825 accepted/tizen/3.0/wearable/20170728.004953 submit/tizen_3.0/20170726.030918 submit/tizen_3.0/20170727.001251
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 26 Jul 2017 03:03:23 +0000 (12:03 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 26 Jul 2017 03:04:12 +0000 (12:04 +0900)
The screen_connector_toolkit_init() MUST be called before
calling screen_connector_toolkit_add().

Change-Id: I1e6692dab3293b0947889d6a7156effa5b59edd8
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
screen_connector_watcher/src/screen_connector_toolkit.c

index 4e5b043..90c07e4 100644 (file)
@@ -390,6 +390,12 @@ EXPORT_API screen_connector_toolkit_h screen_connector_toolkit_add(screen_connec
                return NULL;
        }
 
+       type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(type));
+       if (type_h == NULL) {
+               LOGE("Type(%s) is not initializaed", type);
+               return NULL;
+       }
+
        ops_copy = (screen_connector_toolkit_ops *)calloc(1, sizeof(screen_connector_toolkit_ops));
        if (ops_copy == NULL) {
                LOGE("ops_copy calloc fail");