fix: null dist

This commit is contained in:
lollipopkit
2023-08-28 22:03:21 +08:00
parent d9c26e01f4
commit a302050431
4 changed files with 25 additions and 29 deletions

View File

@@ -109,13 +109,9 @@ String? _parseUpTime(String raw) {
}
String? _parseSysVer(String raw, String hostname) {
try {
final s = raw.split('=');
if (s.length == 2) {
return s[1].replaceAll('"', '').replaceFirst('\n', '');
}
} finally {
// ignore: control_flow_in_finally
return hostname.isEmpty ? null : hostname;
final s = raw.split('=');
if (s.length == 2) {
return s[1].replaceAll('"', '').replaceFirst('\n', '');
}
return hostname.isEmpty ? null : hostname;
}