mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
MINOR Better error checking in AssetAdmin->doUpload() (AIR-41)
This commit is contained in:
parent
aa1ce1af39
commit
88cbd4605e
@ -209,8 +209,12 @@ JS
|
||||
}
|
||||
$processedData = array_reverse($processedData);
|
||||
|
||||
if($data['FolderID'] && $data['FolderID'] != '') $folder = DataObject::get_by_id("Folder", $data['FolderID']);
|
||||
else $folder = singleton('Folder');
|
||||
if($data['FolderID'] && $data['FolderID'] != '') {
|
||||
$folder = DataObject::get_by_id("Folder", $data['FolderID']);
|
||||
if(!$folder) throw new InvalidArgumentException(sprintf("Folder #%d doesn't exist", (int)$data['FolderID']));
|
||||
} else {
|
||||
$folder = singleton('Folder');
|
||||
}
|
||||
|
||||
foreach($processedFiles as $filePostId => $tmpFile) {
|
||||
if($tmpFile['error'] == UPLOAD_ERR_NO_TMP_DIR) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user