[BUGFIX] Catch correct exception if file has been removed 46/19946/2
authorGeorg Ringer <georg.ringer@gmail.com>
Sat, 13 Apr 2013 20:53:45 +0000 (22:53 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Sat, 13 Apr 2013 21:06:20 +0000 (23:06 +0200)
If having a file in the clipboard and the file gets removed,
the wrong exception is caught.

Change-Id: I8561465c3ec2577ebfb2b77e481e3c9dd3821958
Fixes: #47189
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/19945
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-on: https://review.typo3.org/19946

typo3/sysext/backend/Classes/Clipboard/Clipboard.php

index fbd30b3..eb952ac 100644 (file)
@@ -750,7 +750,7 @@ class Clipboard {
                                        } else {
                                                try {
                                                        \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($v);
-                                               } catch (\RuntimeException $e) {
+                                               } catch (\TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException $e) {
                                                        // The file has been deleted in the meantime, so just remove it silently
                                                        unset($this->clipData[$this->current]['el'][$k]);
                                                }