Test assets for valid methods before calling them.
This commit is contained in:
parent
10d96d3816
commit
2c80c501c6
1 changed files with 2 additions and 2 deletions
|
|
@ -48,11 +48,11 @@ sub process {
|
|||
if (Exception::Class->caught()) {
|
||||
return $i18n->get('invalid url');
|
||||
}
|
||||
my $storageId = $asset->storageId;
|
||||
my $storageId = $asset->can('storageId') ? $asset->storageId : undef;
|
||||
if (not defined $storageId) {
|
||||
return $i18n->get('no storage');
|
||||
}
|
||||
my $filename = $asset->filename;
|
||||
my $filename = $asset->can('filename') ? $asset->filename : undef;
|
||||
if (not defined $filename) {
|
||||
return $i18n->get('no filename');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue