Skip to content

Commit fe1fe2c

Browse files
illyaVvengrov
authored andcommitted
fix (Backendless JS SDK): old IE support (#32)
* fix (Backendless JS SDK): old IE support - don't use the method 'catch' of Promises - use Utils.isObject for checking of variable and also check it is not null * fix (Backendless JS SDK): old IE support - don't use the method 'catch' of Promises - checking type of variable is object and also check it is not null or undefined
1 parent 22f3d04 commit fe1fe2c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libs/backendless.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@
658658

659659
var expired = function(obj) {
660660
var result = false;
661-
if (Object.prototype.toString.call(obj).slice(8, -1) == "Object") {
661+
if (obj && Object.prototype.toString.call(obj).slice(8, -1) == "Object") {
662662
if ('cachePolicy' in obj && 'timeToLive' in obj['cachePolicy'] && obj['cachePolicy']['timeToLive'] != -1 && 'created' in obj['cachePolicy']) {
663663
result = (new Date().getTime() - obj['cachePolicy']['created']) > obj['cachePolicy']['timeToLive'];
664664
}
@@ -668,7 +668,7 @@
668668
};
669669

670670
var addTimestamp = function(obj) {
671-
if (Object.prototype.toString.call(obj).slice(8, -1) == "Object") {
671+
if (obj && Object.prototype.toString.call(obj).slice(8, -1) == "Object") {
672672
if ('cachePolicy' in obj && 'timeToLive' in obj['cachePolicy']) {
673673
obj['cachePolicy']['created'] = new Date().getTime();
674674
}
@@ -4386,8 +4386,7 @@
43864386
return Backendless.UserService.getCurrentUser()
43874387
.then(function(user) {
43884388
return Promise.resolve(!!user);
4389-
})
4390-
.catch(function() {
4389+
}, function() {
43914390
return Promise.resolve(false);
43924391
});
43934392
};

0 commit comments

Comments
 (0)