Skip to content

Commit

Permalink
fix: value.trim is not a function error
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Jul 9, 2023
1 parent ba18504 commit 42e4463
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/find-repository-file-endorsements.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ export async function findRepositoryFileEndorsements(
endorsements[login] = [];
}

// ignore if contribution type is empty
// example https://github.com/koolamusic/chakra-ui-autocomplete/commit/d0d313310bab0207a6c7938b69d6eb2e2285aec0#diff-cb22095514d0cab1f755ae3a7902f7d64d10199da210fbd1eb2b29eb758b38d2R23
if (!value.trim()) return endorsements;

try {
// ignore if contribution type is empty
// example https://github.com/koolamusic/chakra-ui-autocomplete/commit/d0d313310bab0207a6c7938b69d6eb2e2285aec0#diff-cb22095514d0cab1f755ae3a7902f7d64d10199da210fbd1eb2b29eb758b38d2R23
if (!value.trim()) return endorsements;

endorsements[login].push(value.toLowerCase());
} catch {
// ignore invalid endorsement syntax. That includes when folks add users with empty contributions
Expand Down

0 comments on commit 42e4463

Please sign in to comment.