Skip to content
Snippets Groups Projects
Commit fc0d9274 authored by Robert Speicher's avatar Robert Speicher
Browse files

Prevent a JS error in MergeRequestTabs

When `window.location.hash` is pointing to a note, e.g. `#note_1234`,
`scrollToElement` would throw an error because a selector such as
`.commits #note_1234` doesn't exist, so `offset()` returned `undefined`.

This error would prevent subsequent calls from running, which caused the
loading spinner to never be hidden.

Now we ensure the selector returns a valid element before trying to
scroll to it.
parent 2fb02f92
No related branches found
No related tags found
Loading
Pipeline #
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment