Don't crash on PRs with empty descriptions

This commit is contained in:
Timothy Andrew 2021-08-04 21:55:54 +05:30
parent eef30d7a68
commit fe31284cd8
No known key found for this signature in database
GPG Key ID: ABD64509E977B249

View File

@ -53,7 +53,7 @@ pub struct PullRequest {
base: PullRequestRef, base: PullRequestRef,
title: String, title: String,
url: String, url: String,
body: String, body: Option<String>,
state: PullRequestStatus, state: PullRequestStatus,
merged_at: Option<String>, merged_at: Option<String>,
draft: bool, draft: bool,
@ -106,7 +106,10 @@ impl PullRequest {
} }
pub fn body(&self) -> &str { pub fn body(&self) -> &str {
&self.body match &self.body {
Some(body) => body,
None => "",
}
} }
pub async fn fetch_reviews( pub async fn fetch_reviews(