From 1ee0d66516cf8f0758dceebf2d360b4685cb4fa0 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Sun, 21 Apr 2013 16:43:44 +0900 Subject: [PATCH] (concord_object_get_feature_value): If `concord_current_env' is not a valid CONCORD_DS object, set NULL. --- cos.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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; -- 1.7.10.4