From fe31284cd8773429150c34be835867f341d6c012 Mon Sep 17 00:00:00 2001 From: Timothy Andrew Date: Wed, 4 Aug 2021 21:55:54 +0530 Subject: [PATCH] Don't crash on PRs with empty descriptions --- src/api/pull_request.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api/pull_request.rs b/src/api/pull_request.rs index 7d05f48..95adfbc 100644 --- a/src/api/pull_request.rs +++ b/src/api/pull_request.rs @@ -53,7 +53,7 @@ pub struct PullRequest { base: PullRequestRef, title: String, url: String, - body: String, + body: Option, state: PullRequestStatus, merged_at: Option, draft: bool, @@ -106,7 +106,10 @@ impl PullRequest { } pub fn body(&self) -> &str { - &self.body + match &self.body { + Some(body) => body, + None => "", + } } pub async fn fetch_reviews(