Skip to content

Commit 528e22f

Browse files
committed
Fixed a bug where network calls could be made and an api key was not set.
1 parent 2ad46a0 commit 528e22f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ExceptionlessClient.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ export class ExceptionlessClient {
114114
}
115115

116116
public submitSessionEnd(sessionIdOrUserId: string): void {
117-
if (sessionIdOrUserId) {
117+
if (sessionIdOrUserId && this.config.enabled && this.config.isValid) {
118118
this.config.log.info(`Submitting session end: ${sessionIdOrUserId}`);
119119
this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, true, this.config);
120120
}
121121
}
122122

123123
public submitSessionHeartbeat(sessionIdOrUserId: string): void {
124-
if (sessionIdOrUserId) {
124+
if (sessionIdOrUserId && this.config.enabled && this.config.isValid) {
125125
this.config.log.info(`Submitting session heartbeat: ${sessionIdOrUserId}`);
126126
this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, false, this.config);
127127
}
@@ -151,7 +151,7 @@ export class ExceptionlessClient {
151151
return cancelled(context);
152152
}
153153

154-
if (!this.config.enabled) {
154+
if (!this.config.enabled || !this.config.isValid) {
155155
this.config.log.info('Event submission is currently disabled.');
156156
return cancelled(context);
157157
}
@@ -198,7 +198,7 @@ export class ExceptionlessClient {
198198
* @param callback The submission response.
199199
*/
200200
public updateUserEmailAndDescription(referenceId: string, email: string, description: string, callback?: (response: SubmissionResponse) => void) {
201-
if (!referenceId || !email || !description || !this.config.enabled) {
201+
if (!referenceId || !email || !description || !this.config.enabled || !this.config.isValid) {
202202
return !!callback && callback(new SubmissionResponse(500, 'cancelled'));
203203
}
204204

0 commit comments

Comments
 (0)