From 01494bf09e2678367b573cd794624a9ef56e5793 Mon Sep 17 00:00:00 2001 From: stianst Date: Thu, 7 Mar 2024 09:17:27 +0100 Subject: [PATCH] Fix NPE on action comment Signed-off-by: stianst --- .../java/org/keycloak/gh/bot/BugActionsOnComment.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/keycloak/gh/bot/BugActionsOnComment.java b/src/main/java/org/keycloak/gh/bot/BugActionsOnComment.java index a8827ad..9297ce6 100644 --- a/src/main/java/org/keycloak/gh/bot/BugActionsOnComment.java +++ b/src/main/java/org/keycloak/gh/bot/BugActionsOnComment.java @@ -21,10 +21,11 @@ public class BugActionsOnComment { void onCommentCreated(@IssueComment.Created GHEventPayload.IssueComment payload) throws IOException { if (Labels.hasLabel(payload.getIssue(), Kind.BUG.toLabel())) { Action action = getAction(payload.getComment().getBody()); - - GHUser sender = payload.getSender(); - if (sender.getType().equals("User") && sender.isMemberOf(payload.getOrganization())) { - bugActions.runAction(action, payload.getIssue()); + if (action != null) { + GHUser sender = payload.getSender(); + if (sender.getType().equals("User") && sender.isMemberOf(payload.getOrganization())) { + bugActions.runAction(action, payload.getIssue()); + } } } }