summaryrefslogtreecommitdiff
path: root/controller/notescontroller.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2015-03-17 19:53:17 +0100
committerChristian Weiske <cweiske@cweiske.de>2015-03-17 19:53:17 +0100
commite19fc06310e26dab3ec372fb01676a802fc02234 (patch)
treeedece44d7c113191c1dd2d671e1d2d214a5fe190 /controller/notescontroller.php
parente74217a7bbd58cf76963c15c73221669e1153510 (diff)
downloadgrauphel-e19fc06310e26dab3ec372fb01676a802fc02234.tar.gz
grauphel-e19fc06310e26dab3ec372fb01676a802fc02234.zip
Send 404 if a note cannot be found
Diffstat (limited to 'controller/notescontroller.php')
-rw-r--r--controller/notescontroller.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/controller/notescontroller.php b/controller/notescontroller.php
index 02bfc93..5618bcb 100644
--- a/controller/notescontroller.php
+++ b/controller/notescontroller.php
@@ -58,6 +58,11 @@ class NotesController extends Controller
public function xml($guid)
{
$note = $this->getNotes()->load($guid, false);
+ if ($note === null) {
+ $res = new ErrorResponse('Note does not exist');
+ $res->setStatus(\OCP\AppFramework\Http::STATUS_NOT_FOUND);
+ return $res;
+ }
$xw = new \XMLWriter();
$xw->openMemory();