From f6eba327853ee4267737e326bb292ecc1275b698 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 13 Aug 2012 21:27:07 +0930 Subject: [PATCH] Bug #19228 Fatal error: Cannot use object of type PEAR_Error --- Weather/Metar.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Weather/Metar.php b/Weather/Metar.php index 2746aa4..46f6a3b 100644 --- a/Weather/Metar.php +++ b/Weather/Metar.php @@ -1842,6 +1842,10 @@ function getWeather($id = "", $unitsFormat = "") // Calculate the moon phase and age $moon = $this->calculateMoonPhase(strtotime($weatherReturn["updateRaw"]." GMT")); + if (Services_Weather::isError($moon)) { + return $moon; + } + $weatherReturn["moon"] = $moon["phase"]; $weatherReturn["moonIcon"] = $moon["icon"];