I\'ve got a problem with a javascript Filereader which returns the error Uncaught TypeError: Failed to execute \'readAsDataURL\' on \'FileReader\': parameter 1 is not of type \'
You need to make sure file has a value (not undefined or null).
undefined
null
At the top of imageFunction:
imageFunction
if(!file) { // handle error condition and return }