Fixes a Javascript error when there's an error to display. refs #5180