Setting contentType to an empty string if it is undefined

This commit is contained in:
pwlin 2017-07-24 15:00:05 +02:00 committed by GitHub
parent f08a0fb154
commit 7be0278c17

View File

@ -27,11 +27,13 @@ var exec = require('cordova/exec');
function FileOpener2() {} function FileOpener2() {}
FileOpener2.prototype.open = function (fileName, contentType, callbackContext) { FileOpener2.prototype.open = function (fileName, contentType, callbackContext) {
contentType = contentType || '';
callbackContext = callbackContext || {}; callbackContext = callbackContext || {};
exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType]); exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType]);
}; };
FileOpener2.prototype.showOpenWithDialog = function (fileName, contentType, callbackContext) { FileOpener2.prototype.showOpenWithDialog = function (fileName, contentType, callbackContext) {
contentType = contentType || '';
callbackContext = callbackContext || {}; callbackContext = callbackContext || {};
exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false]); exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false]);
}; };