Skip to content

Commit

Permalink
Pixelfed was missing a null check
Browse files Browse the repository at this point in the history
  • Loading branch information
aneillans committed Oct 20, 2023
1 parent 89c904b commit 39a6746
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export class Pixelfed extends Megalodon {

// https://{instance}/i/web/post/{id}
getPostIdFromUrl(url: string): string | null {
return url.slice(url.lastIndexOf('/') + 1);
if (url && url.lastIndexOf('/') > -1) {
return url.slice(url.lastIndexOf('/') + 1);
} else {
return null;
}
}
}

0 comments on commit 39a6746

Please sign in to comment.