Fix possibly undefined var

Closes #15268