protected $mShowEmptyLabels = true;
/**
- * @var HTMLForm
+ * @var HTMLForm|null
*/
public $mParent;
* @return Message
*/
protected function getMessage( $value ) {
- return Message::newFromSpecifier( $value )->setContext( $this->mParent );
+ $message = Message::newFromSpecifier( $value );
+
+ if ( $this->mParent ) {
+ $message->setContext( $this->mParent );
+ }
+
+ return $message;
}
/**