Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
fix: invalid GitHub url input (#49)
Browse files Browse the repository at this point in the history
* Fix app crash issue on invalid GitHub URL input in rate screen

* fix app crash issue on invalid GitHub URL input in rate screen when enter  the github url without owner and repo name
  • Loading branch information
Nithishvb authored Jan 4, 2024
1 parent 970d182 commit 040c86f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/api/rate/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function POST(request) {

// 0. get repo from github api
const repoPath = data.url.split("github.com/");
if (repoPath.length !== 2) {
if (repoPath.length !== 2 || !repoPath[1]) {
return Response.json({ success: false, error: "Invalid URL" });
}
const repoData = await getRepo(repoPath[1], session.providerAccessToken);
Expand Down

0 comments on commit 040c86f

Please sign in to comment.