if (currentLocation.indexOf('[') === -1 && currentLocation.indexOf('{') === -1) {
// Maybe a zipped string
- currentLocation = pako.inflate(base64ToBytesArr(currentLocation), {to: 'string'})
- console.log(currentLocation);
+ try {
+ currentLocation = pako.inflate(base64ToBytesArr(currentLocation), {to: 'string'})
+ console.log(currentLocation);
+ } catch (e) {
+ console.warn('Unable to uncompress the data');
+ currentLocation = '';
+ }
}
if (currentLocation === undefined || currentLocation === null || currentLocation === 'null' || currentLocation === '') {
res = defaultLocation;
}
}
- if (res === undefined || res === null || res === 'null') {
+ if (res === undefined || res === null || res === 'null' || res === '') {
res = defaultLocation;
}
return res;