check for src before trying to ajax

pull/1/head
ansuz 2017-05-22 15:12:39 +02:00
parent a6cf761172
commit 6dc3c62ba4
1 changed files with 5 additions and 0 deletions

View File

@ -112,6 +112,11 @@ define([
};
var fetchDecryptedMetadata = function (src, key, cb) {
if (typeof(src) !== 'string') {
return window.setTimeout(function () {
cb('NO_SOURCE');
});
}
fetchMetadata(src, function (e, buffer) {
if (e) { return cb(e); }
cb(void 0, decryptMetadata(buffer, key));