Beware that getContent() may return null
authordaniel <daniel.kinzler@wikimedia.de>
Wed, 24 Oct 2012 13:00:13 +0000 (15:00 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Fri, 9 Nov 2012 18:45:12 +0000 (19:45 +0100)
commitc2172d45e4cd10a7b7d1474ce06f04592e00b913
tree303a77ce250d91afc63feb07477b584b0fc5ee5f
parent0233168ce7ebfc8b33de78bacbbadf165c65e82b
Beware that getContent() may return null

Before the introduction of the content handler, missing content was
signified by getText() returning null instead of a string. null will
work much like an empty string in most contexts, so in many places,
it was not checked explcitely whether the conent was null.

Now, when getContent() returns null, this often caused a fatal error,
because the code would access whatever getContent() returned as an object,
without checking whether it was null (because no such check was performed
previously, when the content was represented as a string).

This check introduces explicite checks for getContent() returning null
in the most essential core classes.

Change-Id: I551a90b0b67b8edc7570ca5d252ecc1de903f097
includes/Article.php
includes/Revision.php
includes/Title.php
includes/WikiPage.php
includes/diff/DifferenceEngine.php
includes/job/jobs/DoubleRedirectJob.php
includes/job/jobs/RefreshLinksJob.php
includes/parser/Parser.php
includes/resourceloader/ResourceLoaderWikiModule.php
includes/search/SearchEngine.php