Add null check to formData.append

This commit is contained in:
Annabel Dunstone 2016-04-18 13:04:36 -05:00
parent e6ee1f36c4
commit beb32f31fb

View file

@ -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')