Skip to content

Commit e97f752

Browse files
Adds null check for status before checking status code. Avoids throwing exceptions if status is not defined. (#145)
* Adds check for status in responseMap as part of error checking. * formats file
1 parent d020c42 commit e97f752

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/io.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ class IOCommandProcessor implements CommandProcessor {
103103

104104
if (response.statusCode < 200 ||
105105
response.statusCode > 299 ||
106-
(respBody is Map && respBody['status'] != 0)) {
106+
(respBody is Map
107+
&& respBody['status'] != null
108+
&& respBody['status'] != 0)) {
107109
throw new WebDriverException(
108110
httpStatusCode: response.statusCode,
109111
httpReasonPhrase: response.reasonPhrase,

0 commit comments

Comments
 (0)