From 329d2195a716f2931dbf252264f647900cfdc263 Mon Sep 17 00:00:00 2001 From: Juan Gilsanz Polo Date: Tue, 13 Jun 2023 12:53:10 +0200 Subject: [PATCH 1/2] Bugs fixed --- lib/models/logs.dart | 2 +- lib/models/server_info.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/models/logs.dart b/lib/models/logs.dart index 9c21bca..0dd5f6e 100644 --- a/lib/models/logs.dart +++ b/lib/models/logs.dart @@ -80,7 +80,7 @@ class Log { elapsedMs: json["elapsedMs"], question: Question.fromJson(json["question"]), reason: json["reason"], - rules: List.from(json["rules"].map((x) => Rule.fromJson(x))), + rules: json["rules"] != null ? List.from(json["rules"].map((x) => Rule.fromJson(x))) : [], status: json["status"], time: DateTime.parse(json["time"]), upstream: json["upstream"], diff --git a/lib/models/server_info.dart b/lib/models/server_info.dart index 84f9a57..8d26857 100644 --- a/lib/models/server_info.dart +++ b/lib/models/server_info.dart @@ -43,7 +43,7 @@ class ServerInfoData { dnsPort: json["dns_port"], httpPort: json["http_port"], protectionEnabled: json["protection_enabled"], - dhcpAvailable: json["dhcp_available"], + dhcpAvailable: json["dhcp_available"] ?? false, running: json["running"], version: json["version"], language: json["language"], From d1973a55dbe81d1489c4f94335f48ccbdfffddae Mon Sep 17 00:00:00 2001 From: Juan Gilsanz Polo Date: Tue, 13 Jun 2023 12:56:35 +0200 Subject: [PATCH 2/2] Bug fix --- lib/widgets/add_server_modal.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/add_server_modal.dart b/lib/widgets/add_server_modal.dart index 51d8b22..3f384e8 100644 --- a/lib/widgets/add_server_modal.dart +++ b/lib/widgets/add_server_modal.dart @@ -392,7 +392,7 @@ class _AddServerModalState extends State { (version['data'].contains('a') || version['data'].contains('b')) // alpha or beta ) { Navigator.pop(context); - widget.onUnsupportedVersion(version); + widget.onUnsupportedVersion(version['data']); } else { Navigator.pop(context);