From 307f07a4402e77b70ca47819a0e3f66b7cf8c008 Mon Sep 17 00:00:00 2001 From: Mofasa Date: Sun, 27 Dec 2020 10:25:43 +0800 Subject: [PATCH] Fixed no response return onload callback If there is nothing return from `onload` callback, use xhr.response by default --- src/js/app/utils/createFileProcessorFunction.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/app/utils/createFileProcessorFunction.js b/src/js/app/utils/createFileProcessorFunction.js index 3158e93a..11078843 100644 --- a/src/js/app/utils/createFileProcessorFunction.js +++ b/src/js/app/utils/createFileProcessorFunction.js @@ -48,7 +48,7 @@ export const createFileProcessorFunction = (apiUrl, action, name, options) => (f createResponse( 'load', xhr.status, - onload(xhr.response), + onload(xhr.response) || xhr.response, xhr.getAllResponseHeaders() ) ); @@ -71,4 +71,4 @@ export const createFileProcessorFunction = (apiUrl, action, name, options) => (f // should return request return request; -}; \ No newline at end of file +};