favGifSearch: don't error on favourited non-urls (#2260)

main
stupid cat 8 months ago committed by GitHub
parent afdcf0edb9
commit f3ee43fe66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -200,7 +200,14 @@ function SearchBar({ instance, SearchBarComponent }: { instance: Instance; Searc
export function getTargetString(urlStr: string) {
const url = new URL(urlStr);
let url: URL;
try {
url = new URL(urlStr);
} catch (err) {
// Can't resolve URL, return as-is
return urlStr;
}
switch (settings.store.searchOption) {
case "url":
return url.href;

Loading…
Cancel
Save