From 2a9a0eae68f404c5cf98a3a6f266db3da028dab8 Mon Sep 17 00:00:00 2001
From: Eric Huss <eric@huss.org>
Date: Tue, 7 Jan 2025 06:28:37 -0800
Subject: [PATCH] Handle deleted labels

---
 src/github.rs                | 4 +++-
 src/handlers/notify_zulip.rs | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/github.rs b/src/github.rs
index d1588a0b..b08786f1 100644
--- a/src/github.rs
+++ b/src/github.rs
@@ -1168,7 +1168,9 @@ pub enum IssuesAction {
     },
     Unlabeled {
         /// The label removed from the issue
-        label: Label,
+        ///
+        /// The `label` is `None` when a label is deleted from the repository.
+        label: Option<Label>,
     },
     Locked,
     Unlocked,
diff --git a/src/handlers/notify_zulip.rs b/src/handlers/notify_zulip.rs
index ba697813..1dcfbf18 100644
--- a/src/handlers/notify_zulip.rs
+++ b/src/handlers/notify_zulip.rs
@@ -32,7 +32,7 @@ pub(super) async fn parse_input(
     };
 
     match &event.action {
-        IssuesAction::Labeled { label } | IssuesAction::Unlabeled { label } => {
+        IssuesAction::Labeled { label } | IssuesAction::Unlabeled { label: Some(label) } => {
             let applied_label = label.clone();
             Ok(config
                 .labels