Skip to content

Avoid a TypeError when initializing MergeRequest JS class with no arg

What does this MR do?

Avoid a TypeError when initializing MergeRequest JS class with no arg.

Are there points in the code the reviewer needs to double check?

No.

Why was this MR needed?

Without this sane default you would get the following error when you tried to instantiate a new MergeRequest object with no argument (i.e. new MergeRequest();):

TypeError: undefined is not an object (evaluating 'this.opts.action')

What are the relevant issue numbers?

Fixes #13525 (closed).

Does this MR meet the acceptance criteria?

  • No CHANGELOG since it's a trivial internal change
  • Tests
    • Added for this feature/bug
    • All builds are passing
  • Conform by the style guides
  • Branch has no merge conflicts with master (if you do - rebase it please)
  • Squashed related commits together

Merge request reports