Skip to content

Add proper null check for task item rendering

Simon Knox requested to merge psi-task-null-desc into master

What does this MR do and why?

Fix an error when rendering issues with empty description. this.$el.querySelectorAll is undefined`

We previously only checked for this.$el, but when description is empty it is still truthy (it returns an empty HTML comment as a string). So we were running renderTaskActions, then called String.querySelectorAll, which errored.

Moved null check into the function, and tested on the function itself so we know we've got ourselves a node

Testing

  1. Enable work_items feature flag
  2. Load an issue with empty description
  3. Check no console errors
Edited by Simon Knox

Merge request reports

Loading