File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 5252use OCA \Files_Versions \Db \VersionsMapper ;
5353use OCA \Files_Versions \Events \CreateVersionEvent ;
5454use OCA \Files_Versions \Versions \IVersionManager ;
55+ use OCP \AppFramework \Db \DoesNotExistException ;
5556use OCP \Files \FileInfo ;
5657use OCP \Files \Folder ;
5758use OCP \Files \IRootFolder ;
@@ -592,11 +593,16 @@ public static function expireOlderThanMaxForUser($uid) {
592593 // Check that the version does not have a label.
593594 $ path = $ versionsRoot ->getRelativePath ($ info ->getPath ());
594595 $ node = $ userFolder ->get (substr ($ path , 0 , -strlen ('.v ' .$ version )));
595- $ versionEntity = $ versionsMapper ->findVersionForFileId ($ node ->getId (), $ version );
596- $ versionEntities [$ info ->getId ()] = $ versionEntity ;
596+ try {
597+ $ versionEntity = $ versionsMapper ->findVersionForFileId ($ node ->getId (), $ version );
598+ $ versionEntities [$ info ->getId ()] = $ versionEntity ;
597599
598- if ($ versionEntity ->getLabel () !== '' ) {
599- return false ;
600+ if ($ versionEntity ->getLabel () !== '' ) {
601+ return false ;
602+ }
603+ } catch (DoesNotExistException $ ex ) {
604+ // Version on FS can have no equivalent in the DB if they were created before the version naming feature.
605+ // So we ignore DoesNotExistException.
600606 }
601607
602608 // Check that the version's timestamp is lower than $threshold
You can’t perform that action at this time.
0 commit comments