1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-18 21:10:40 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

return null if error

This commit is contained in:
sunnylqm
2024-03-03 08:49:46 +08:00
parent 2845a4302a
commit 592e13b77b

View File

@@ -20,5 +20,7 @@ export const testUrls = async (urls?: string[]) => {
if (!urls?.length || (await canUseGoogle)) {
return null;
}
return Promise.race(urls.map((url) => ping(url).then(() => url)));
return Promise.race(urls.map((url) => ping(url).then(() => url))).catch(
() => null,
);
};