Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(ui): handle null values in postgres metrics (#6388)

Pritam Yadavf01341bfbf6f
diff --git a/app/Models/StandalonePostgresql.php b/app/Models/StandalonePostgresql.php
index 689134a32f..6f1d03cc63 100644
--- a/app/Models/StandalonePostgresql.php
+++ b/app/Models/StandalonePostgresql.php
@@ -320,7 +320,10 @@ class StandalonePostgresql extends BaseModel
}
$metrics = json_decode($metrics, true);
$parsedCollection = collect($metrics)->map(function ($metric) {
- return [(int) $metric['time'], (float) $metric['percent']];
+ return [
+ (int) $metric['time'],
+ (float) ($metric['percent'] ?? 0.0)
+ ];
});
return $parsedCollection->toArray();