Add null check to formData.append
This commit is contained in:
parent
e6ee1f36c4
commit
beb32f31fb
1 changed files with 3 additions and 2 deletions
|
@ -45,9 +45,10 @@ class @Profile
|
|||
|
||||
saveForm: ->
|
||||
self = @
|
||||
|
||||
formData = new FormData(@form[0])
|
||||
formData.append('user[avatar]', @avatarGlCrop.getBlob(), 'avatar.png')
|
||||
|
||||
avatarBlob = @avatarGlCrop.getBlob()
|
||||
formData.append('user[avatar]', avatarBlob, 'avatar.png') if avatarBlob?
|
||||
|
||||
$.ajax
|
||||
url: @form.attr('action')
|
||||
|
|
Loading…
Reference in a new issue