Skip to content

Commit

Permalink
CryptoJS.TKE._setMasterKey() is now checking if the container is open…
Browse files Browse the repository at this point in the history
…, too
  • Loading branch information
Gabor Heja committed Dec 27, 2012
1 parent eb078a3 commit 6491c55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/crypto-js_tke.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ CryptoJS.TKE || (function (undefined) {

_setMasterKey: function(cfg)
{
if (this.data != null)
if (this.data != null && this.containerIsOpen)
{
throw new Error("Cannot set master key as container already holds data, you may want to reset() the container.");
throw new Error("Cannot set master key as container already holds data and is open, you may want to close() and reset() the container.");
}

this.masterKey = cfg;
Expand Down

0 comments on commit 6491c55

Please sign in to comment.