Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2017
dbtdsilva
libcloudstorage
Commits
538183f3
Commit
538183f3
authored
Aug 21, 2017
by
Paweł Wegner
Browse files
GetItemRequest: fixed when item not found.
parent
596a29af
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Request/GetItemRequest.cpp
View file @
538183f3
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment