Не проверять файлы, если поля аттача нет

This commit is contained in:
isqua 2015-02-08 16:58:55 +03:00
parent 2d98767bdd
commit 0089798f86
1 changed files with 6 additions and 2 deletions

View File

@ -95,9 +95,13 @@ AjaxComments.prototype.isProperKeys = function(event) {
* @return {Boolean} Выбран ли файл
*/
AjaxComments.prototype.isFileSelected = function($form) {
var files = $form.get(0).elements.attach.files;
var attach = $form.get(0).elements.attach;
return Boolean(files && files.length);
if (attach) {
return Boolean(attach.files && attach.files.length);
} else {
return false;
}
};
/**