From 1168a8c0a0147f3241101584aaef20b7947b8346 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 4 May 2015 09:15:15 -0700 Subject: [PATCH] Don't add resources to Multimeter when there's no multimeter running Summary: Fixes T8058. Don't add a Multimeter event if we aren't running multimeter (e.g., in unit tests). Test Plan: Will `arc unit --everything`. Reviewers: joshuaspence, btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T8058 Differential Revision: https://secure.phabricator.com/D12699 --- .../celerity/CelerityStaticResourceResponse.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/applications/celerity/CelerityStaticResourceResponse.php b/src/applications/celerity/CelerityStaticResourceResponse.php index f3412ad4cc..3f34b7634f 100644 --- a/src/applications/celerity/CelerityStaticResourceResponse.php +++ b/src/applications/celerity/CelerityStaticResourceResponse.php @@ -144,8 +144,11 @@ final class CelerityStaticResourceResponse { $uri = $this->getURI($map, $name); $type = $map->getResourceTypeForName($name); - $event_type = MultimeterEvent::TYPE_STATIC_RESOURCE; - MultimeterControl::getInstance()->newEvent($event_type, 'rsrc.'.$name, 1); + $multimeter = MultimeterControl::getInstance(); + if ($multimeter) { + $event_type = MultimeterEvent::TYPE_STATIC_RESOURCE; + $multimeter->newEvent($event_type, 'rsrc.'.$name, 1); + } switch ($type) { case 'css':