|
var retrieveFile = handlerExec(sharedData.retrieveFileHandlers, sharedData.internalRetrieveFileHandlers); |
|
function handlerExec(list, internalList) { |
|
return function(arg) { |
|
for (var i = 0; i < list.length; i++) { |
|
var ret = list[i](arg); |
|
if (ret) { |
|
return ret; |
|
} |
If a file is empty, retrieveFile can return empty string. This is falsey, and today is erroneously interpreted as "no response," causing subsequent retrieveFile handlers to be invoked.
We can change retrieveFile to allow returning undefined and fix the logic to interpret empty string as empty file.
Note: Is a breaking change.