Skip to content

Probot Crashes if PR Description Body is Empty #26

Description

@matthewdfuller

Probot, with the probot-commands extension installed, will crash if a PR is opened and the description is empty (set to null in the GitHub event).

Steps to reproduce:

  1. Configure probot-commands:
const probotCommands = require('probot-commands');
const handler = require('path/to/handler');

module.exports = (app) => {
    // Listen to slash commands
    // ['issue_comment.created', 'issues.opened', 'pull_request.opened']
    probotCommands(app, 'mycommand', handler);
};
  1. Go to GitHub (on a repo where the app is installed) and open a new pull request.
  2. Leave the PR description empty.
  3. Submit the PR
  4. Probot crashes with a 500 error:
INFO (http): POST / 500 - 3745ms
    err: {
      "type": "Error",
      "message": "failed with status code 500",
      "stack":
          Error: failed with status code 500
              at ServerResponse.onResFinished (/myapp/node_modules/pino-http/logger.js:77:38)
              at ServerResponse.emit (node:events:525:35)
              at ServerResponse.emit (node:domain:489:12)
              at onFinish (node:_http_outgoing:950:10)
              at callback (node:internal/streams/writable:555:21)
              at afterWrite (node:internal/streams/writable:500:5)
              at afterWriteTick (node:internal/streams/writable:487:10)
              at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
    }
ERROR (server): Internal Server Error
    Error: Internal Server Error
        at Request.callback (/myapp/node_modules/superagent/lib/node/index.js:921:17)
        at IncomingMessage.<anonymous> (/myapp/node_modules/superagent/lib/node/index.js:1165:20)
        at IncomingMessage.emit (node:events:525:35)
        at IncomingMessage.emit (node:domain:489:12)
        at endReadableNT (node:internal/streams/readable:1359:12)
        at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
status: 500

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions