*engine = strdup(g_config_info->engine_id);
} else {
SLOG(LOG_ERROR, stt_tag(), " Engine id is NULL"); //LCOV_EXCL_LINE
+ *engine = NULL;
return STT_CONFIG_ERROR_ENGINE_NOT_FOUND;
}
while (NULL != iter) {
engine_info = iter->data;
- if (NULL != engine_info) {
+ if (NULL != engine_info && NULL != engine_info->uuid) {
if (0 == strcmp(engine, engine_info->uuid)) {
return true;
}
if (0 != stt_config_mgr_get_engine(engine_id)) {
SLOG(LOG_ERROR, TAG_STTD, "[Config ERROR] Fail to get engine id");
+ return -1;
}
return 0;
/* get current engine from config */
if (0 == sttd_config_get_default_engine(&cur_engine_uuid)) {
SECURE_SLOG(LOG_DEBUG, TAG_STTD, "[Engine Agent] current engine from config : %s", cur_engine_uuid);
- if (NULL != g_engine_info->engine_uuid) {
+ if (NULL != g_engine_info->engine_uuid && NULL != cur_engine_uuid) {
if (!strcmp(g_engine_info->engine_uuid, cur_engine_uuid)) {
is_default_engine = true;
}