diff --git a/lib/Service/NotesService.php b/lib/Service/NotesService.php index 1716bc106..8e8eed2e6 100644 --- a/lib/Service/NotesService.php +++ b/lib/Service/NotesService.php @@ -210,12 +210,12 @@ private function getCustomExtension(string $userId) { * @throws NoteDoesNotExistException */ private static function getFileById(string $customExtension, Folder $folder, int $id) : File { - $file = $folder->getById($id); + $file = $folder->getFirstNodeById($id); - if (!array_key_exists(0, $file) || !($file[0] instanceof File) || !self::isNote($file[0], $customExtension)) { + if (!($file instanceof File) || !self::isNote($file, $customExtension)) { throw new NoteDoesNotExistException(); } - return $file[0]; + return $file; } /**