diff --git a/sdk/scannerlib/HGLibDeviceImpl.cpp b/sdk/scannerlib/HGLibDeviceImpl.cpp index c079c3ca..4d421c7c 100644 --- a/sdk/scannerlib/HGLibDeviceImpl.cpp +++ b/sdk/scannerlib/HGLibDeviceImpl.cpp @@ -560,18 +560,19 @@ HGLibDeviceParamGroup* HGLibDeviceImpl::GetParamGroupList(HGUInt* count) devParam.valueType = HGLIB_OPTION_VALUETYPE_ENUM; devParam.stringValue = value; - assert(SANE_CONSTRAINT_STRING_LIST == desp->constraint_type); + devParam.rangeType = HGLIB_OPTION_VALUERANGETYPE_ENUMLIST; + if (SANE_CONSTRAINT_STRING_LIST == desp->constraint_type) + { + const SANE_String_Const* p = desp->constraint.string_list; + while (NULL != *p) + { + devParam.stringValueList.push_back(*p); + ++p; + } - devParam.rangeType = HGLIB_OPTION_VALUERANGETYPE_ENUMLIST; - const SANE_String_Const* p = desp->constraint.string_list; - while (NULL != *p) - { - devParam.stringValueList.push_back(*p); - ++p; - } - - assert(!devParams.empty()); - devParams[devParams.size() - 1].devParams.push_back(devParam); + assert(!devParams.empty()); + devParams[devParams.size() - 1].devParams.push_back(devParam); + } } else if (SANE_TYPE_INT == desp->type) { @@ -763,15 +764,16 @@ HGLibDeviceParam* HGLibDeviceImpl::GetParam(HGUInt option) devParam.valueType = HGLIB_OPTION_VALUETYPE_ENUM; devParam.stringValue = value; - assert(SANE_CONSTRAINT_STRING_LIST == desp->constraint_type); - - devParam.rangeType = HGLIB_OPTION_VALUERANGETYPE_ENUMLIST; - const SANE_String_Const* p = desp->constraint.string_list; - while (NULL != *p) - { - devParam.stringValueList.push_back(*p); - ++p; - } + devParam.rangeType = HGLIB_OPTION_VALUERANGETYPE_ENUMLIST; + if (SANE_CONSTRAINT_STRING_LIST == desp->constraint_type) + { + const SANE_String_Const* p = desp->constraint.string_list; + while (NULL != *p) + { + devParam.stringValueList.push_back(*p); + ++p; + } + } } else if (SANE_TYPE_INT == desp->type) { diff --git a/sdk/webservice/ManagerV2.cpp b/sdk/webservice/ManagerV2.cpp index 684f5a2d..6932cdfe 100644 --- a/sdk/webservice/ManagerV2.cpp +++ b/sdk/webservice/ManagerV2.cpp @@ -3528,18 +3528,19 @@ namespace ver_2 devParam.valueType = 1; devParam.stringValue = value; - assert(SANE_CONSTRAINT_STRING_LIST == desp->constraint_type); + devParam.rangeType = 1; + if (SANE_CONSTRAINT_STRING_LIST == desp->constraint_type) + { + const SANE_String_Const* p = desp->constraint.string_list; + while (NULL != *p) + { + devParam.stringValueList.push_back(*p); + ++p; + } - devParam.rangeType = 1; - const SANE_String_Const* p = desp->constraint.string_list; - while (NULL != *p) - { - devParam.stringValueList.push_back(*p); - ++p; - } - - assert(!devParams.empty()); - devParams[devParams.size() - 1].devParams.push_back(devParam); + assert(!devParams.empty()); + devParams[devParams.size() - 1].devParams.push_back(devParam); + } } else if (SANE_TYPE_INT == desp->type) {