Fix ResTypePkgFilterChecker
[platform/core/appfw/pkgmgr-info.git] / src / server / filter_checker / pkg_filter_checker / restype_pkg_filter_checker.cc
index f1a5861..367fcfd 100644 (file)
@@ -21,8 +21,13 @@ namespace database {
 
 bool ResTypePkgFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
                                           package_x* info) {
-  return (info->removable == nullptr || info->removable[0] == '\0' ||
-          strcasecmp(node->value, info->removable) == 0);
+  if (!info->res_type)
+    return false;
+
+  if (node->value == nullptr || strlen(node->value) == 0)
+    return info->res_type != nullptr;
+  
+  return strcmp(node->value, info->res_type) == 0;
 }
 
 }  // namespace database