Skip to content

Commit

Permalink
Merge pull request #212 from rekka/fix-188
Browse files Browse the repository at this point in the history
Do not panic on an empty filename in MemoryIo
  • Loading branch information
pkgw committed Aug 27, 2018
2 parents a357e1c + 4eb02a1 commit 9c439da
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/io/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ impl MemoryIo {

impl IoProvider for MemoryIo {
fn output_open_name(&mut self, name: &OsStr) -> OpenResult<OutputHandle> {
assert!(!name.is_empty(), "name must be non-empty");
if name.is_empty() {
return OpenResult::NotAvailable;
}

let name = normalize_tex_path(name);

Expand All @@ -132,7 +134,9 @@ impl IoProvider for MemoryIo {
}

fn input_open_name(&mut self, name: &OsStr, _status: &mut StatusBackend) -> OpenResult<InputHandle> {
assert!(!name.is_empty(), "name must be non-empty");
if name.is_empty() {
return OpenResult::NotAvailable;
}

let name = normalize_tex_path(name);

Expand Down

0 comments on commit 9c439da

Please sign in to comment.