Call to a member function getMessageText() on null


#1

Forgive me if this a question that has been covered elsewhere, I’ve dug for a while and can’t find a solution. I have new install of phabricator, php 7.2, ubuntu 18.04, and after setting up two different email services to send outbound mail I continue to get the error;

Call to a member function getMessageText() on null

the developer mode also lists

Anyone have thoughts/areas that I should be looking into discovering why this might be?


#2

Looks like it’s new bug from https://secure.phabricator.com/D19995.

I’ll file a ticket, but a workaround might be something like this:

diff --git src/applications/people/controller/PhabricatorPeopleWelcomeController.php src/applications/people/controller/PhabricatorPeopleWelcomeController.php
index 3fb75265ff..94d5e0bb03 100644
--- src/applications/people/controller/PhabricatorPeopleWelcomeController.php
+++ src/applications/people/controller/PhabricatorPeopleWelcomeController.php
@@ -51,7 +51,7 @@ final class PhabricatorPeopleWelcomeController
     $default_message = PhabricatorAuthMessage::loadMessage(
       $admin,
       PhabricatorAuthWelcomeMailMessageType::MESSAGEKEY);
-    if (strlen($default_message->getMessageText())) {
+    if ($default_message != null && strlen($default_message->getMessageText())) {
       $message_instructions = pht(
         'The email will identify you as the sender. You may optionally '.
         'replace the [[ %s | default custom mail body ]] with different text '.

#3

This indeed solves the issue. I updated it via GitHub, signed your CLA, however, I then read you don’t accept PR’s so there is that. Either way working locally now.

Bug squashed. Thanks.


#4

Thanks, this should be fixed in master and stable now.