Commit 538183f3 authored by Paweł Wegner's avatar Paweł Wegner
Browse files

GetItemRequest: fixed when item not found.

parent 596a29af
......@@ -51,15 +51,15 @@ IItem::Pointer GetItemRequest::getItem(const std::vector<IItem::Pointer>& items,
void GetItemRequest::work(IItem::Pointer item, std::string p,
Callback complete) {
if (p.empty() || p.size() == 1) {
complete(item);
return done(item);
}
if (!item) {
Error e{IHttpRequest::NotFound, "not found"};
complete(e);
return done(e);
}
if (p.empty() || p.size() == 1) {
complete(item);
return done(item);
}
auto path = p.substr(1);
auto it = path.find_first_of('/');
std::string name = it == std::string::npos
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment