Skip to content

Commit

Permalink
fix crash when stt recordings user folder does not exist anymore
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Mar 22, 2024
1 parent 64d28eb commit be87a5f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Service/SpeechToText/SpeechToTextService.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,14 @@ private function getFileObject(string $userId, string $tempFileLocation): File {
}
$this->config->setAppValue(Application::APP_ID, 'stt_folder', $sttFolderName);
} else {
$sttFolder = $userFolder->get($sttFolderName);
try {
$sttFolder = $userFolder->get($sttFolderName);
} catch (NotFoundException $e) {
// it was deleted
$sttFolder = $this->getUniqueNamedFolder($userId);
$sttFolderName = $sttFolder->getName();
$this->config->setAppValue(Application::APP_ID, 'stt_folder', $sttFolderName);
}
if (!$sttFolder instanceof Folder) {
// the folder created by this app was tampered with
// create a new one
Expand Down

0 comments on commit be87a5f

Please sign in to comment.