fix: Check logic

This commit is contained in:
Suraj Shetty 2021-03-04 19:47:14 +05:30 committed by GitHub
parent e8090889ce
commit e586badf3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,7 +83,7 @@ frappe.ui.form.ControlAttach = frappe.ui.form.ControlData.extend({
// Important: We have to be careful because normal filenames may also contain ","
let file_url_parts = this.value.match(/^([^:]+),(.+):(.+)$/);
let filename;
if (!file_url_parts) {
if (file_url_parts) {
filename = file_url_parts[1];
dataurl = file_url_parts[2] + ':' + file_url_parts[3];
}