Skip to content

Commit

Permalink
hotfix(schema-viewer): invalid schema reference caused application to…
Browse files Browse the repository at this point in the history
… creash
  • Loading branch information
zaghaghi committed May 6, 2024
1 parent 7ae823a commit bf458a0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openapi-tui"
version = "0.9.1"
version = "0.9.2"
edition = "2021"
description = "This TUI allows you to list and browse APIs described by the openapi specification."

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ Then, add `openapi-tui` to your `configuration.nix`
- [X] Plain Response Viewer (Status + Headers + Body)
- [X] History viewer
- [X] Refactor footer, add flash footer messages

# Next Release
- [X] Import request body file
- [X] Save response body and header
- [X] Command history with ↑/↓
Expand Down
7 changes: 5 additions & 2 deletions src/components/schema_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ impl SchemaViewer {
}

fn set_styles_by_name(&mut self, schema_name: String) -> Result<()> {
let schema = self.components.get(schema_name.as_str()).unwrap();
self.set_styles(schema.clone())
if let Some(schema) = self.components.get(schema_name.as_str()) {
self.set_styles(schema.clone())
} else {
Ok(())
}
}
}

0 comments on commit bf458a0

Please sign in to comment.