D564 has a view policy restricting it temporarily to @Sandlayth and me.
The notification fired when I changed this view policy triggers the following bug when Phabricator tries to get the repository of the diff (to further get the repositories' projects and sort the notification into the right group).
The fact Phabricator fires this notifications at first is disputable and should be reported upstream as a security issue.
But independently of the Phabricator issue, when we don't have access to an object, we should fail gracefully and perhaps use the default group as fallback.
**Payload**
```lang=json
{"storyID":"8485","storyType":"PhabricatorApplicationTransactionFeedStory","storyData":{"objectPHID":"PHID-DREV-iqc4ipnohzrpzfoav7vt","transactionPHIDs":{"PHID-XACT-DREV-yc3h2xufxxu3pmq":"PHID-XACT-DREV-yc3h2xufxxu3pmq"}},"storyAuthorPHID":"PHID-USER-fnetlprx7zdotfm2hdrz","storyText":"dereckson changed the visibility for D564: WIP: start documentation.","epoch":"1469410725"}
```
**Error log**
```lang=plain
[2016-07-31 23:01:48] production.INFO: [Gate] New payload. {"service":"Phabricator","door":"Nasqueron"}
[2016-07-31 23:01:49] production.ERROR: exception 'ErrorException' with message 'Trying to get property of non-object' in /var/wwwroot/default/app/Phabricator/
PhabricatorStory.php:176
Stack trace:
#0 /var/wwwroot/default/app/Phabricator/PhabricatorStory.php(176): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Trying to get p...', '/var
/wwwroot/de...', 176, Array)
#1 /var/wwwroot/default/app/Phabricator/PhabricatorStory.php(135): Nasqueron\Notifications\Phabricator\PhabricatorStory->getRepositoryPHID('differential.qu...'
)
#2 /var/wwwroot/default/app/Phabricator/PhabricatorStory.php(247): Nasqueron\Notifications\Phabricator\PhabricatorStory->getProjectsPHIDs()
#3 /var/wwwroot/default/app/Phabricator/PhabricatorStory.php(235): Nasqueron\Notifications\Phabricator\PhabricatorStory->attachProjects()
#4 /var/wwwroot/default/app/Analyzers/Phabricator/PhabricatorPayloadAnalyzer.php(118): Nasqueron\Notifications\Phabricator\PhabricatorStory->getProjects()
#5 /var/wwwroot/default/app/Notifications/PhabricatorNotification.php(61): Nasqueron\Notifications\Analyzers\Phabricator\PhabricatorPayloadAnalyzer->getGroup()
#6 /var/wwwroot/default/app/Notifications/PhabricatorNotification.php(38): Nasqueron\Notifications\Notifications\PhabricatorNotification->getGroup()
#7 /var/wwwroot/default/app/Jobs/FirePhabricatorNotification.php(52): Nasqueron\Notifications\Notifications\PhabricatorNotification->__construct('Nasqueron', O
bject(Nasqueron\Notifications\Phabricator\PhabricatorStory))
#8 /var/wwwroot/default/app/Jobs/FirePhabricatorNotification.php(38): Nasqueron\Notifications\Jobs\FirePhabricatorNotification->createNotification()
#9 /var/wwwroot/default/app/Listeners/NotificationListener.php(48): Nasqueron\Notifications\Jobs\FirePhabricatorNotification->handle()
#10 [internal function]: Nasqueron\Notifications\Listeners\NotificationListener->onPhabricatorPayload(Object(Nasqueron\Notifications\Events\PhabricatorPayloadE
vent))
#11 /var/wwwroot/default/bootstrap/cache/compiled.php(10050): call_user_func_array(Array, Array)
#12 [internal function]: Illuminate\Events\Dispatcher->Illuminate\Events\{closure}(Object(Nasqueron\Notifications\Events\PhabricatorPayloadEvent))
#13 /var/wwwroot/default/bootstrap/cache/compiled.php(9995): call_user_func_array(Object(Closure), Array)
#14 /var/wwwroot/default/bootstrap/cache/compiled.php(6226): Illuminate\Events\Dispatcher->fire(Object(Nasqueron\Notifications\Events\PhabricatorPayloadEvent))
#15 /var/wwwroot/default/app/Http/Controllers/Gate/PhabricatorGateController.php(89): Illuminate\Support\Facades\Facade::__callStatic('fire', Array)
#16 /var/wwwroot/default/app/Http/Controllers/Gate/PhabricatorGateController.php(89): Illuminate\Support\Facades\Event::fire(Object(Nasqueron\Notifications\Eve
nts\PhabricatorPayloadEvent))
#17 /var/wwwroot/default/app/Http/Controllers/Gate/PhabricatorGateController.php(52): Nasqueron\Notifications\Http\Controllers\Gate\PhabricatorGateController->
onPayload()
#18 [internal function]: Nasqueron\Notifications\Http\Controllers\Gate\PhabricatorGateController->onPost('Nasqueron')
#19 /var/wwwroot/default/bootstrap/cache/compiled.php(9294): call_user_func_array(Array, Array)
#20 /var/wwwroot/default/bootstrap/cache/compiled.php(9356): Illuminate\Routing\Controller->callAction('onPost', Array)
#21 /var/wwwroot/default/bootstrap/cache/compiled.php(9336): Illuminate\Routing\ControllerDispatcher->call(Object(Nasqueron\Notifications\Http\Controllers\Gate
\PhabricatorGateController), Object(Illuminate\Routing\Route), 'onPost')
#22 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#23 /var/wwwroot/default/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#24 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#25 /var/wwwroot/default/bootstrap/cache/compiled.php(9813): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#26 /var/wwwroot/default/bootstrap/cache/compiled.php(9337): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#27 /var/wwwroot/default/bootstrap/cache/compiled.php(9324): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(Nasqueron\Notifications\Http\Contr
ollers\Gate\PhabricatorGateController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'onPost')
#28 /var/wwwroot/default/bootstrap/cache/compiled.php(8411): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illumin
ate\Http\Request), 'Nasqueron\\Notif...', 'onPost')
#29 /var/wwwroot/default/bootstrap/cache/compiled.php(8398): Illuminate\Routing\Route->runController(Object(Illuminate\Http\Request))
#30 /var/wwwroot/default/bootstrap/cache/compiled.php(8112): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#31 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#32 /var/wwwroot/default/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#33 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#34 /var/wwwroot/default/bootstrap/cache/compiled.php(9813): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#35 /var/wwwroot/default/bootstrap/cache/compiled.php(8113): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#36 /var/wwwroot/default/bootstrap/cache/compiled.php(8104): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate
\Http\Request))
#37 /var/wwwroot/default/bootstrap/cache/compiled.php(8094): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#38 /var/wwwroot/default/bootstrap/cache/compiled.php(2400): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#39 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#40 /var/wwwroot/default/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#41 /var/wwwroot/default/bootstrap/cache/compiled.php(3172): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#42 [internal function]: Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#43 /var/wwwroot/default/bootstrap/cache/compiled.php(9823): call_user_func_array(Array, Array)
#44 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#45 /var/wwwroot/default/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#46 /var/wwwroot/default/bootstrap/cache/compiled.php(13255): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#47 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 /var/wwwroot/default/bootstrap/cache/compiled.php(9823): call_user_func_array(Array, Array)
#49 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#50 /var/wwwroot/default/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#51 /var/wwwroot/default/bootstrap/cache/compiled.php(11807): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#52 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#53 /var/wwwroot/default/bootstrap/cache/compiled.php(9823): call_user_func_array(Array, Array)
#54 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#55 /var/wwwroot/default/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#56 /var/wwwroot/default/bootstrap/cache/compiled.php(12990): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#57 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#58 /var/wwwroot/default/bootstrap/cache/compiled.php(9823): call_user_func_array(Array, Array)
#59 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#60 /var/wwwroot/default/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#61 /var/wwwroot/default/bootstrap/cache/compiled.php(12927): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#62 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#63 /var/wwwroot/default/bootstrap/cache/compiled.php(9823): call_user_func_array(Array, Array)
#64 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#65 /var/wwwroot/default/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#66 /var/wwwroot/default/bootstrap/cache/compiled.php(3233): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#67 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#68 /var/wwwroot/default/bootstrap/cache/compiled.php(9823): call_user_func_array(Array, Array)
#69 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#70 /var/wwwroot/default/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#71 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#72 /var/wwwroot/default/bootstrap/cache/compiled.php(9813): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#73 /var/wwwroot/default/bootstrap/cache/compiled.php(2347): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#74 /var/wwwroot/default/bootstrap/cache/compiled.php(2331): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#75 /var/wwwroot/default/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#76 {main}
```