Skip to content

Commit

Permalink
Adds null check for status before checking status code. Avoids throwi…
Browse files Browse the repository at this point in the history
…ng exceptions if status is not defined. (#145)

* Adds check for status in responseMap as part of error checking.

* formats file
  • Loading branch information
staats-google authored Apr 10, 2017
1 parent d020c42 commit e97f752
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ class IOCommandProcessor implements CommandProcessor {

if (response.statusCode < 200 ||
response.statusCode > 299 ||
(respBody is Map && respBody['status'] != 0)) {
(respBody is Map
&& respBody['status'] != null
&& respBody['status'] != 0)) {
throw new WebDriverException(
httpStatusCode: response.statusCode,
httpReasonPhrase: response.reasonPhrase,
Expand Down

0 comments on commit e97f752

Please sign in to comment.