Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Fix issue with decoding metrics JSON

hunteraraujo470cfa6c4e84
diff --git a/frontend/lib/models/benchmark/metrics.dart b/frontend/lib/models/benchmark/metrics.dart
index b428415d35..6500aed9a5 100644
--- a/frontend/lib/models/benchmark/metrics.dart
+++ b/frontend/lib/models/benchmark/metrics.dart
@@ -49,7 +49,9 @@ class Metrics {
difficulty: json['difficulty'] ?? "",
success: json['success'],
attempted: json['attempted'],
- successPercentage: json['success_percentage'].toDouble() ?? 0.0,
+ successPercentage: (json['success_percentage'] != null)
+ ? json['success_percentage'].toDouble()
+ : 0.0,
cost: json['cost'] ?? "",
runTime: json['run_time'] ?? "",
);