kou commented on code in PR #36460:
URL: https://github.com/apache/arrow/pull/36460#discussion_r1252340590


##########
.github/workflows/dev_pr/link.js:
##########
@@ -84,7 +84,7 @@ async function commentGitHubURL(github, context, 
pullRequestNumber, issueID) {
   const issueInfo = await helpers.getGitHubInfo(github, context, issueID, 
pullRequestNumber);
   const message = "* Closes: #" + issueInfo.number
   if (issueInfo) {
-    if (context.payload.pull_request.body.includes(message)) {
+    if (context.payload.pull_request.body != null && 
context.payload.pull_request.body.includes(message)) {

Review Comment:
   How about simplifying this?
   
   ```js
       if (context.payload.pull_request.body && 
context.payload.pull_request.body.includes(message)) {
   ```
   
   or
   
   ```js
   const body = context.payload.pull_request.body || "";
   if (body.includes(message)) {
     return;
   }
   await github.rest.pulls.update({..., body: body + "\n" + message});
   ```
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to