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.

Enhance Info model to handle optional JSON fields gracefully

hunteraraujo3c35cab55e04
diff --git a/frontend/lib/models/skill_tree/info.dart b/frontend/lib/models/skill_tree/info.dart
index c5e61212bb..2f8b289fbc 100644
--- a/frontend/lib/models/skill_tree/info.dart
+++ b/frontend/lib/models/skill_tree/info.dart
@@ -11,9 +11,9 @@ class Info {
factory Info.fromJson(Map<String, dynamic> json) {
return Info(
- difficulty: json['difficulty'],
- description: json['description'],
- sideEffects: List<String>.from(json['side_effects']),
+ difficulty: json['difficulty'] ?? "",
+ description: json['description'] ?? "",
+ sideEffects: List<String>.from(json['side_effects'] ?? []),
);
}
}