Created
July 3, 2019 14:17
-
-
Save andreastt/7c21b8f94cb1598a29d993d2134f1f15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/message.rs b/src/message.rs | |
index aa98505..252a06d 100644 | |
--- a/src/message.rs | |
+++ b/src/message.rs | |
@@ -125,7 +125,9 @@ impl<'de> Visitor<'de> for MessageVisitor { | |
let params: Params = match name { | |
Command::WebDriver(ref cmd) => match cmd { | |
FindElement => { | |
- Params::Locator(seq.next_element::<webdriver::Locator>()?.unwrap()) | |
+ let locator = seq.next_element::<webdriver::Locator>()? | |
+ .ok_or_else(|| de::Error::missing_field("missing parameters!"))?; | |
+ Params::Locator(locator) | |
} | |
GetTimeouts => Params::None, | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment