Problem/Motivation
in #3238849: Refactor (if feasible) use of jquery is function to use vanillaJS the jQuery is()
function was phased out. In some cases the replacements didn't account for jQuery implicitly checking for the existence of an element before checking its property. Without this, there's an error when the check is occuring on a nonexistent element.
Steps to reproduce
Proposed resolution
Check if element exists before checking a property of it.