From: MORIOKA Tomohiko Date: Sun, 21 Apr 2013 07:43:44 +0000 (+0900) Subject: (concord_object_get_feature_value): If `concord_current_env' is not X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=1ee0d66516cf8f0758dceebf2d360b4685cb4fa0;p=chise%2Fconcord.git (concord_object_get_feature_value): If `concord_current_env' is not a valid CONCORD_DS object, set NULL. --- diff --git a/cos.c b/cos.c index 878b8c9..42b66dd 100644 --- a/cos.c +++ b/cos.c @@ -552,6 +552,7 @@ COS_object concord_object_get_feature_value (COS_object object, COS_object feature) { char id_buf[256]; + CONCORD_Genre gobj; CONCORD_Feature fobj; CONCORD_String_Tank val_st; size_t end; @@ -563,8 +564,17 @@ concord_object_get_feature_value (COS_object object, COS_object feature) else return NULL; - fobj = concord_get_feature (concord_current_env, - "character", feature); + if (!COS_OBJECT_DS_P (concord_current_env)) + { + concord_current_env = NULL; + return NULL; + } + + gobj = concord_get_genre (concord_current_env, "character"); + if (gobj == NULL) + return NULL; + + fobj = concord_get_feature (concord_current_env, gobj, feature); if (fobj == NULL) return NULL;