jgraph/drawio-nextcloud

FileDeleteListener causing log entry on EVERY file delete

alx-tuilmenau opened this issue · 1 comments

Hello,

after the update to 2.0.2 the FileDeleteListener causes a log entry on EVERY file deletion. All files without a drawio preview will cause an FileNotFoundException, deleted previews will log an error (why - it was succesful?).
Please fix this, maybe this way:

try
   {
            $prevFolder = $this->appData->getFolder('previews');
            if ($prevFolder->fileExists($node->getId() . '.png')) { 
                        $prevFolder->getFile($node->getId() . '.png')->delete();
            }
    }
catch (\Exception $e)

Thanks for the report. We'll add your fix in the next version