Revert
r45038 "only call pageStats function in Skin::printFooter if $wgArticle is an object. this might not always be the case (tested with a custom skin extending the Skin class) and if so, a fatal error is shown on the page (tested with Special: pages) and footer won't be rendered"
Skin::pageStats() has checks meant to catch this already. If they're faulty, fix them there.