Skip to content

Commit

Permalink
fix: Found out change from field can be null
Browse files Browse the repository at this point in the history
smh...
  • Loading branch information
MrExplode committed Nov 2, 2023
1 parent b500fa1 commit dd45007
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/jira.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ fn decorate_issue_embed(e: &mut Embed, data: &JiraData, project_url: String, iss

for item in &data.changelog.items {
e.field(&item.field, "", false)
.field("From", &item.from_string, true)
.field("To", &item.to_string, true);
.field("From", &item.from_string.unwrap_or("(unknown)".to_string()), true)
.field("To", &item.to_string.unwrap_or("(unknown)".to_string()), true);
}
}
"jira:issue_deleted" => {
Expand Down
4 changes: 2 additions & 2 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ pub struct JiraChangelog {
pub struct JiraChangelogItem {
pub field: String,
pub field_id: String,
pub from_string: String,
pub to_string: String,
pub from_string: Option<String>,
pub to_string: Option<String>,
}

0 comments on commit dd45007

Please sign in to comment.