diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2015-03-17 19:53:17 +0100 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2015-03-17 19:53:17 +0100 |
| commit | e19fc06310e26dab3ec372fb01676a802fc02234 (patch) | |
| tree | edece44d7c113191c1dd2d671e1d2d214a5fe190 /controller/notescontroller.php | |
| parent | e74217a7bbd58cf76963c15c73221669e1153510 (diff) | |
| download | grauphel-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.php | 5 |
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(); |
