There was an error while loading. Please reload this page.
1 parent 4df638c commit a1fb241Copy full SHA for a1fb241
1 file changed
src/hooks/useSearch.ts
@@ -195,6 +195,8 @@ export default function useSearch(
195
const search = async () => {
196
const searchResult: Search = await retrieve();
197
198
+ const bgpApiError = searchResult.type == 'empty-match';
199
+
200
if (searchResult.error_msg) {
201
return setError(searchResult.error_msg);
202
}
@@ -209,7 +211,7 @@ export default function useSearch(
209
211
let nextAsns = arrayFromCommaSeperated(params.asns);
210
212
213
// fill in the asn provided in the search result
- if (validatePrefix) {
214
+ if (validatePrefix && !bgpApiError) {
215
const resultAsns = searchResult.result.meta
216
.map((m) => (m.originASNs ? m.originASNs : null))
217
.find((asns) => asns);
0 commit comments