This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts-bot.git


The following commit(s) were added to refs/heads/master by this push:
     new baca251  fix potential NPE
baca251 is described below

commit baca251b9b3fd1ac7209f7c35f3e5342b0a635a4
Author: plainheart <[email protected]>
AuthorDate: Fri Jul 1 16:10:16 2022 +0800

    fix potential NPE
---
 index.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index 8c48b71..07c1bf1 100644
--- a/index.js
+++ b/index.js
@@ -503,11 +503,14 @@ async function hasCommented(context, commentText) {
  *
  * @param {Context} context
  * @param {string} commentText
- * @param {ReportedContentClassifiers} classifier
+ * @param {ReportedContentClassifiers?} classifier
  */
 async function minimizeComment(context, commentText, classifier) {
     const comments = (await 
context.octokit.issues.listComments(context.issue())).data;
     const comment = comments.find(comment => comment.user.type === 'Bot' && 
comment.body === commentText);
+    if (!comment) {
+        return;
+    }
     try {
         const res = await context.octokit.graphql(
             `


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to