Skip to content

Commit

Permalink
added check of frozen object to avoid type error
Browse files Browse the repository at this point in the history
  • Loading branch information
MdHusainThekiya committed Jun 11, 2023
1 parent ff3b111 commit d7a14f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/broker/saslAuthenticator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ module.exports = class SASLAuthenticator {
!this.connection.sasl.authenticationProvider &&
Object.keys(BUILT_IN_AUTHENTICATION_PROVIDERS).includes(mechanism)
) {
if (Object.isFrozen(this.connection.sasl)) {
this.connection.sasl = Object.assign({}, this.connection.sasl)
}
this.connection.sasl.authenticationProvider = BUILT_IN_AUTHENTICATION_PROVIDERS[mechanism](
this.connection.sasl
)
Expand Down

0 comments on commit d7a14f9

Please sign in to comment.