I had to add an `if (filedata !== null) {}` around this line in case someone tries to upload an empty file. Empty files seem to work fine in other browsers already.