check empty 32/297832/1 accepted/tizen_8.0_unified tizen_8.0 accepted/tizen/8.0/unified/20231005.093303 accepted/tizen/unified/20230825.182735 tizen_8.0_m2_release
authorYoungjae Shin <yj99.shin@samsung.com>
Fri, 25 Aug 2023 06:09:52 +0000 (15:09 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Fri, 25 Aug 2023 06:09:52 +0000 (15:09 +0900)
Change-Id: Idf3d748ee899c6bb3b13ee6b20eeb918d7ffdb0b

src/server/MethodCallHandler.cpp

index 9560424..a6c3902 100644 (file)
@@ -100,12 +100,13 @@ void MethodCallHandler::__query(IMethodCall* methodCall)
        Json::CharReaderBuilder builder;
        std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
 
-       bool ret = reader->parse(filter, filter+strlen(filter), &jfilter, &errors);
-       if (false == ret) {
-               _E("Json::CharReader::parse() Fail(%s)", errors.c_str());
-               throw static_cast<int>(E_FAILED);
+       if (filter && *filter != '\0') {
+               bool ret = reader->parse(filter, filter+strlen(filter), &jfilter, &errors);
+               if (false == ret) {
+                       _E("Json::CharReader::parse(%s) Fail(%s)", filter, errors.c_str());
+                       throw static_cast<int>(E_FAILED);
+               }
        }
-
        std::vector<std::shared_ptr<Tuple>> result;
        std::vector<std::string> columnNames;