Skip to content

Commit

Permalink
Merge pull request #31 from ably-forks/fix/channel-auth-preattach
Browse files Browse the repository at this point in the history
Fix channel preattach errCallback null check
  • Loading branch information
sacOO7 committed Dec 22, 2023
2 parents a8494a1 + c38be8e commit ddfeba7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/channel/ably/attach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ export const beforeChannelAttach = (ablyClient, authorize: Function) => {

authorize(this, (error) => {
this.authorizing = false;
if (error && errCallback) {
errCallback(error);
if (error) {
if (errCallback) {
errCallback(error);
} else {
console.error(`channel ${this.name} auth error => ${error}`)
}
return;
} else {
bindedInternalAttach(forceReattach, attachReason, errCallback);
Expand Down

0 comments on commit ddfeba7

Please sign in to comment.