Page MenuHomePhabricator

Prevent crash caused by empty array when rendering Pholio mocks
ClosedPublic

Authored by hach-que on Jul 30 2014, 1:10 AM.
Tags
None
Referenced Files
F15588361: D10073.id.diff
Fri, May 9, 7:03 AM
F15585561: D10073.diff
Thu, May 8, 9:58 AM
F15551441: D10073.id24227.diff
Sun, Apr 27, 5:00 PM
F15547015: D10073.diff
Sat, Apr 26, 5:49 PM
F15517073: D10073.diff
Fri, Apr 18, 11:46 PM
F15482358: D10073.id24227.diff
Apr 9 2025, 4:53 AM
F15481551: D10073.id24226.diff
Apr 8 2025, 9:41 PM
F15479925: D10073.id24228.diff
Apr 8 2025, 10:16 AM

Details

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.

Diff Detail

Repository
rP Phabricator
Branch
pholio-crash
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1930
Build 1931: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

hach-que retitled this revision from to Prevent crash caused by variable usage outside foreach loop.
hach-que updated this object.
hach-que edited the test plan for this revision. (Show Details)
hach-que added a reviewer: Blessed Reviewers.
hach-que added a subscriber: rfergu.
hach-que edited edge metadata.

Correct fix?

hach-que retitled this revision from Prevent crash caused by variable usage outside foreach loop to Prevent crash caused by empty array when rendering Pholio mocks.Jul 30 2014, 1:49 AM
hach-que updated this object.
hach-que edited the test plan for this revision. (Show Details)

@rfergu has confirmed that this fixes the crash.

hach-que added a reviewer: epriestley.
epriestley edited edge metadata.

This could just be if ($images_to_show), I think.

This revision is now accepted and ready to land.Jul 30 2014, 3:21 AM
hach-que edited edge metadata.

Changes requested

hach-que updated this revision to Diff 24254.

Closed by commit rPde40cf5ef7d6 (authored by @hach-que).