not giving an error for undefined href / download-url

This commit is contained in:
Ralf Becker 2015-04-14 13:12:17 +00:00
parent 335d099bfd
commit cdd8b29fa7

View File

@ -332,7 +332,7 @@ var et2_vfsMime = expose(et2_valueWidget.extend([et2_IDetachedDOM],
href: _value.download_url href: _value.download_url
}]; }];
// check if download_url is not already an url (some stream-wrappers allow to specify that!) // check if download_url is not already an url (some stream-wrappers allow to specify that!)
if (_value.download_url[0] == '/' || _value.download_url.substr(0, 4) != 'http') if (_value.download_url && (_value.download_url[0] == '/' || _value.download_url.substr(0, 4) != 'http'))
{ {
mediaContent[0].href = base_url + _value.download_url; mediaContent[0].href = base_url + _value.download_url;