mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +00:00
do not set undefined properties
This commit is contained in:
@@ -51,6 +51,11 @@ function initCryptoService(constantsService) {
|
|||||||
CryptoService.prototype.setEncKey = function (encKey) {
|
CryptoService.prototype.setEncKey = function (encKey) {
|
||||||
var deferred = Q.defer();
|
var deferred = Q.defer();
|
||||||
|
|
||||||
|
if (encKey === undefined) {
|
||||||
|
deferred.resolve();
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
chrome.storage.local.set({
|
chrome.storage.local.set({
|
||||||
'encKey': encKey
|
'encKey': encKey
|
||||||
}, function () {
|
}, function () {
|
||||||
@@ -64,6 +69,11 @@ function initCryptoService(constantsService) {
|
|||||||
CryptoService.prototype.setEncPrivateKey = function (encPrivateKey) {
|
CryptoService.prototype.setEncPrivateKey = function (encPrivateKey) {
|
||||||
var deferred = Q.defer();
|
var deferred = Q.defer();
|
||||||
|
|
||||||
|
if (encPrivateKey === undefined) {
|
||||||
|
deferred.resolve();
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
chrome.storage.local.set({
|
chrome.storage.local.set({
|
||||||
'encPrivateKey': encPrivateKey
|
'encPrivateKey': encPrivateKey
|
||||||
}, function () {
|
}, function () {
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ function initSyncService() {
|
|||||||
|
|
||||||
self.apiService.getProfile(function (response) {
|
self.apiService.getProfile(function (response) {
|
||||||
self.userService.getSecurityStamp().then(function (stamp) {
|
self.userService.getSecurityStamp().then(function (stamp) {
|
||||||
if (stamp && stamp != response.securityStamp) {
|
if (stamp && stamp !== response.securityStamp) {
|
||||||
if (self.logoutCallback) {
|
if (self.logoutCallback) {
|
||||||
self.logoutCallback(true, function () { });
|
self.logoutCallback(true, function () { });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ function initUserService() {
|
|||||||
UserService.prototype.setSecurityStamp = function (stamp) {
|
UserService.prototype.setSecurityStamp = function (stamp) {
|
||||||
var deferred = Q.defer();
|
var deferred = Q.defer();
|
||||||
|
|
||||||
|
if (stamp === undefined) {
|
||||||
|
deferred.resolve();
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
_stamp = stamp;
|
_stamp = stamp;
|
||||||
var stampObj = {};
|
var stampObj = {};
|
||||||
stampObj[stampKey] = stamp;
|
stampObj[stampKey] = stamp;
|
||||||
|
|||||||
Reference in New Issue
Block a user