fix: error was shown on first app start
This commit is contained in:
parent
88cfa4d29f
commit
73c6299c25
|
@ -67,12 +67,14 @@ class PageController extends Controller {
|
|||
// check if notes folder is accessible
|
||||
try {
|
||||
$this->notesService->checkNotesFolder($this->userId);
|
||||
// check if note exists
|
||||
try {
|
||||
$this->notesService->get($lastViewedNote, $this->userId);
|
||||
} catch(\Exception $ex) {
|
||||
$lastViewedNote = 0;
|
||||
$errorMessage = $this->l10n->t('The last viewed note cannot be accessed. ').$ex->getMessage();
|
||||
if($lastViewedNote) {
|
||||
// check if note exists
|
||||
try {
|
||||
$this->notesService->get($lastViewedNote, $this->userId);
|
||||
} catch(\Exception $ex) {
|
||||
$lastViewedNote = 0;
|
||||
$errorMessage = $this->l10n->t('The last viewed note cannot be accessed. ').$ex->getMessage();
|
||||
}
|
||||
}
|
||||
} catch(\Exception $e) {
|
||||
$errorMessage = $this->l10n->t('The notes folder is not accessible: %s', $e->getMessage());
|
||||
|
|
Loading…
Reference in New Issue