From 304599eab050f727ce130344f7ed5a08be598692 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 12 Oct 2012 18:05:55 -0700 Subject: [PATCH] Use the default skin if a blog has a set but no-longer-available skin Summary: I set one of my blogs to "phacility.com" based on `arc patch` and it now fatals since that's not a valid class anymore. :P Recover from these cases. Test Plan: Viewed blog, no missing symbole exception. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T1373 Differential Revision: https://secure.phabricator.com/D3692 --- src/applications/phame/storage/PhameBlog.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/applications/phame/storage/PhameBlog.php b/src/applications/phame/storage/PhameBlog.php index 1e2141d9b7..cb516ae31e 100644 --- a/src/applications/phame/storage/PhameBlog.php +++ b/src/applications/phame/storage/PhameBlog.php @@ -53,9 +53,15 @@ final class PhameBlog extends PhameDAO { } public function getSkinRenderer() { - $skin = $this->getSkin(); + try { + $skin = newv($this->getSkin(), array()); + } catch (PhutilMissingSymbolException $ex) { + // If this blog has a skin but it's no longer available (for example, + // it was uninstalled) just return the default skin. + $skin = newv(self::SKIN_DEFAULT, array()); + } - return new $skin(); + return $skin; } /**