summaryrefslogtreecommitdiff
path: root/src/controls.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/controls.rs')
-rw-r--r--src/controls.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/controls.rs b/src/controls.rs
index 8a10824..48d71ae 100644
--- a/src/controls.rs
+++ b/src/controls.rs
@@ -82,7 +82,15 @@ impl Control {
)),
"interact" => Some(Control::Interact(
parse_directions(val.get(1)?)?,
- val.get(2).map(|v| Some(v.as_str()?.to_string())).flatten()
+ if let Some(argument) = val.get(2) {
+ match argument {
+ Value::String(arg) => Some(arg.to_string()),
+ Value::Null => None,
+ _ => {return None}
+ }
+ } else {
+ None
+ }
)),
_ => None
}