mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-17 22:29:15 +00:00
fix: Wrap DNS check in catch to avoid runtime crash
This commit is contained in:
parent
645d58d513
commit
8f7730575e
|
@ -218,19 +218,23 @@ class ServerInstallationRepository {
|
|||
final Map<String, bool> skippedMatches,
|
||||
) async {
|
||||
final Map<String, bool> matches = <String, bool>{};
|
||||
await InternetAddress.lookup(domainName!).then(
|
||||
(final records) {
|
||||
for (final record in records) {
|
||||
if (skippedMatches[record.host] ?? false) {
|
||||
matches[record.host] = true;
|
||||
continue;
|
||||
try {
|
||||
await InternetAddress.lookup(domainName!).then(
|
||||
(final records) {
|
||||
for (final record in records) {
|
||||
if (skippedMatches[record.host] ?? false) {
|
||||
matches[record.host] = true;
|
||||
continue;
|
||||
}
|
||||
if (record.address == ip4!) {
|
||||
matches[record.host] = true;
|
||||
}
|
||||
}
|
||||
if (record.address == ip4!) {
|
||||
matches[record.host] = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
|
||||
return matches;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue