Fix dereference of NULL issue detected by static analysis tool 41/109641/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 11 Jan 2017 04:12:49 +0000 (13:12 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 11 Jan 2017 04:25:25 +0000 (20:25 -0800)
Change-Id: I6dc65949b23122dfb1086b1d3db597c6e42fa4d0

scl/utils/linux/sclutils-linux.cpp

index 8d1e773..28ca3fe 100644 (file)
@@ -88,9 +88,11 @@ static void accessibility_changed_cb(keynode_t *key, void* data)
     int enabled = 0;
     if (vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &enabled) == 0) {
         LOGD("VCONFKEY_SETAPPL_ACCESSIBILITY_TTS : %d, (%p)", enabled, tts);
+        CSCLContext *context = CSCLContext::get_instance();
+        if (context)
+            context->set_tts_enabled(enabled);
+
         if (enabled) {
-            CSCLContext *context = CSCLContext::get_instance();
-            context->set_tts_enabled(true);
             if (tts == NULL) {
                 LOGD("Initializing TTS\n");