I'd do this as first line, and also add a onerror callback doing this and calling callback with the original blob.