Skip to content

Commit a7e99d7

Browse files
author
Sergey Khomushin
committed
EmailJSResponseStatus: improve the type
1 parent 36c68a2 commit a7e99d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/models/EmailJSResponseStatus.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ export class EmailJSResponseStatus {
22
public status: number;
33
public text: string;
44

5-
constructor(httpResponse: XMLHttpRequest) {
6-
this.status = httpResponse.status;
7-
this.text = httpResponse.responseText;
5+
constructor(httpResponse: XMLHttpRequest | null) {
6+
this.status = httpResponse?.status || 0;
7+
this.text = httpResponse?.responseText || 'network error';
88
}
99
}

0 commit comments

Comments
 (0)