Skip to content

Commit

Permalink
Merge pull request #862 from Detegr/master
Browse files Browse the repository at this point in the history
Fix `enter` crashing on nonexistent file
  • Loading branch information
andrasio committed Oct 22, 2019
2 parents 81f8ba9 + 8f03561 commit 5b701cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/commands/enter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::commands::command::CommandAction;
use crate::commands::PerItemCommand;
use crate::commands::UnevaluatedCallInfo;
use crate::data::meta::Span;
use crate::errors::ShellError;
use crate::parser::registry;
use crate::prelude::*;
Expand Down Expand Up @@ -34,10 +33,12 @@ impl PerItemCommand for Enter {
match call_info.args.expect_nth(0)? {
Tagged {
item: Value::Primitive(Primitive::Path(location)),
tag,
..
} => {
let location_string = location.display().to_string();
let location_clone = location_string.clone();
let tag_clone = tag.clone();

if location.starts_with("help") {
let spec = location_string.split(":").collect::<Vec<&str>>();
Expand Down Expand Up @@ -71,9 +72,8 @@ impl PerItemCommand for Enter {
crate::commands::open::fetch(
&full_path,
&location_clone,
Span::unknown(),
)
.await.unwrap();
tag_clone.span,
).await?;

match contents {
Value::Primitive(Primitive::String(_)) => {
Expand Down

0 comments on commit 5b701cd

Please sign in to comment.