diff --git a/home/inc/class.home_weather_portlet.inc.php b/home/inc/class.home_weather_portlet.inc.php index 577c7fc701..91c5ad97de 100644 --- a/home/inc/class.home_weather_portlet.inc.php +++ b/home/inc/class.home_weather_portlet.inc.php @@ -136,7 +136,7 @@ class home_weather_portlet extends home_portlet $current = file_get_contents($url); if($debug) error_log(__METHOD__ . ' current: ' . $current); - return array_merge(array('current' => json_decode($current,true)), json_decode($forecast,true)); + return array_merge(array('current' => json_decode($current, true)), (array)json_decode($forecast, true)); }, array($query), self::CACHE_TIME); // Some sample data, if you need to test diff --git a/home/js/Et2PortletWeather.ts b/home/js/Et2PortletWeather.ts index a055c75a15..e28c391ddb 100644 --- a/home/js/Et2PortletWeather.ts +++ b/home/js/Et2PortletWeather.ts @@ -131,7 +131,7 @@ export class Et2PortletWeather extends Et2Portlet const current = this.settings?.weather?.current || {weather: [{icon: "question-lg"}], temp: {temp: "?"}}; // Get the forecast, excluding today - let list = this.settings.weather && (Object.values(this.settings?.weather?.list).slice(1) || []); + let list = this.settings.weather && (Object.values(this.settings?.weather?.list || {}).slice(1) || []); return html`