Change to that anyone can remove a krate who has no author 81/132881/2 accepted/tizen/unified/20170629.085345 submit/tizen/20170614.105206
authorSungbae Yoo <sungbae.yoo@samsung.com>
Thu, 8 Jun 2017 06:49:20 +0000 (15:49 +0900)
committerSungbae Yoo <sungbae.yoo@samsung.com>
Wed, 14 Jun 2017 09:45:04 +0000 (18:45 +0900)
Change-Id: I71679e8de871fc9e80d89708fadd1183383f106f
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
server/manager.cpp

index d98a688..2747e3b 100644 (file)
@@ -597,10 +597,14 @@ int Manager::removeKrate(const std::string& name)
 
        manifestFile.reset(xml::Parser::parseFile(confPath + "/" + name + ".xml"));
        xml::Node::NodeList authors = manifestFile->evaluate("/manifest/author");
-       for (const xml::Node& author : authors) {
-               if (author.getContent() == pkgId) {
-                       canRemove = true;
-                       break;
+       if (authors.size() == 0) {
+               canRemove = true;
+       } else {
+               for (const xml::Node& author : authors) {
+                       if (author.getContent() == pkgId) {
+                               canRemove = true;
+                               break;
+                       }
                }
        }