@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Prevent crash caused by empty array when rendering Pholio mocks

Summary: This was causing a crash according to a conversation with @rfergu in IRC. The issue is that if `$images_to_show` is empty, then `$image` never gets set, and it attempts to call `getID` on a null / unset variable.

Test Plan: @rfergu confirmed this fixed the crash.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, rfergu, epriestley

Differential Revision: https://secure.phabricator.com/D10073

+3
+3
src/applications/pholio/view/PholioMockEmbedView.php
··· 26 26 if (!empty($this->images)) { 27 27 $images_to_show = array_intersect_key( 28 28 $this->mock->getImages(), array_flip($this->images)); 29 + } 30 + 31 + if ($images_to_show) { 29 32 foreach ($images_to_show as $image) { 30 33 $thumbfile = $image->getFile(); 31 34 $thumbnail = $thumbfile->getThumb280x210URI();