Skip to content

Fix unhandled error for missing design collection

Jack Chapman requested to merge jachapman-handle-missing-design-collection into master

What does this MR do and why?

When the response is returned for the design widget, it's possible the Work Item does not have a designCollection set (this is the case according to the GQL schema too).

The update method does not protect against this case, causing an unhandled error to be thrown (designCollection is null).

Uncaught TypeError: designWidget.designCollection is null

This change adds a quick check for the presence of designCollection. If it's null the code will return early.

As a side note, this is the type of bug that would be caught if we were using TypeScript

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. View an Issue Work Item in a modal (e.g. click an issue as a child of a namespace level work item)
  2. Check the browser console
  3. This branch will have no error relating to designCollection, but master will.

Merge request reports