Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CarnetApp/CarnetNextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPhie <phie@phie.ovh>2019-08-17 18:02:39 +0300
committerPhie <phie@phie.ovh>2019-08-17 18:02:39 +0300
commit90b832fad562adf027b3917fb690ba3f674b73b7 (patch)
tree1885fa4401ce694fb51103857d9ec10b6f837565 /lib
parent4ff1ecb3ab94be2448aabe22b58e477323c9691c (diff)
don't crash when no recendb or keyworddb folder
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Controller/NoteController.php6
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;