forked from extern/egroupware
Home: Avoid breaking home if weather didn't find city
This commit is contained in:
parent
fe0c125458
commit
bc989f7108
@ -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
|
||||
|
@ -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`
|
||||
<div
|
||||
|
Loading…
Reference in New Issue
Block a user