Fix possible TypeError when preparing red links
Fix possible TypeError when preparing red links

Fixes a TypeError appearing occasionally in logstash when replaceChild
is called on the undefined parentNode of an element identified as a
probable red link.

Unfortunately, the request URL is not captured for this error, so we
cannot identify the class name identifying the element in question as a
probable red link.

Change-Id: I990af60d8ab7f8fa86320e4efdfc59cda5b612ed

wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps