diff options
author | Phie <phie@phie.ovh> | 2019-08-17 18:02:39 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2019-08-17 18:02:39 +0300 |
commit | 90b832fad562adf027b3917fb690ba3f674b73b7 (patch) | |
tree | 1885fa4401ce694fb51103857d9ec10b6f837565 /lib | |
parent | 4ff1ecb3ab94be2448aabe22b58e477323c9691c (diff) |
don't crash when no recendb or keyworddb folder
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Controller/NoteController.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php index b5deeab..6038e16 100755 --- a/lib/Controller/NoteController.php +++ b/lib/Controller/NoteController.php @@ -176,7 +176,8 @@ try { return $this->CarnetFolder->get("quickdoc/recentdb/recentnc"); } catch(\OCP\Files\NotFoundException $e) { - $this->CarnetFolder->newFolder('/quickdoc/recentdb', 0777, true); + if(!$this->CarnetFolder->nodeExists('/quickdoc/recentdb')) + $this->CarnetFolder->newFolder('/quickdoc/recentdb', 0777, true); $file = $this->CarnetFolder->newFile("quickdoc/recentdb/recentnc"); $file->putContent("{\"data\":[]}"); return $file; @@ -231,7 +232,8 @@ try { return $this->CarnetFolder->get("quickdoc/keywords/keywordsnc"); } catch(\OCP\Files\NotFoundException $e) { - $this->CarnetFolder->newFolder('/quickdoc/keywords', 0777, true); + if(!$this->CarnetFolder->nodeExists('/quickdoc/keywords')) + $this->CarnetFolder->newFolder('/quickdoc/keywords', 0777, true); $file = $this->CarnetFolder->newFile("quickdoc/keywords/keywordsnc"); $file->putContent("{\"data\":[]}"); return $file; |