From 904e93c443f0078113d65f9c3bb47fe68ad1e64e Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Thu, 8 Jun 2017 15:49:20 +0900 Subject: [PATCH] Change to that anyone can remove a krate who has no author Change-Id: I71679e8de871fc9e80d89708fadd1183383f106f Signed-off-by: Sungbae Yoo --- server/manager.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server/manager.cpp b/server/manager.cpp index d98a688..2747e3b 100644 --- a/server/manager.cpp +++ b/server/manager.cpp @@ -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; + } } } -- 2.7.4