mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-20 13:59:12 +00:00
Fix
This commit is contained in:
parent
565494e3f9
commit
3c42f790bd
1 changed files with 11 additions and 4 deletions
|
@ -39,10 +39,17 @@ class ApiClientV2 {
|
|||
Future<ApiResponse> getServerVersion() async {
|
||||
final result = await HttpRequestClient.get(urlPath: '/status', server: server);
|
||||
if (result.successful == true) {
|
||||
try {
|
||||
return ApiResponse(
|
||||
successful: true,
|
||||
content: jsonDecode(result.body!)['version']
|
||||
);
|
||||
} on FormatException {
|
||||
return const ApiResponse(successful: false);
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
return const ApiResponse(successful: false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return const ApiResponse(successful: false);
|
||||
|
|
Loading…
Add table
Reference in a new issue