Skip to content

Commit

Permalink
fix: Don't attempt to process empty author map string
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemerrett committed Aug 26, 2024
1 parent 7196381 commit fcebb5c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9597,6 +9597,9 @@ function run() {
*/
function createAuthorToTwistMap(input) {
const mapping = {};
if (!input) {
return mapping;
}
for (const individual of input.split(',')) {
const [username, twistUserID] = individual.split(':');
if (!username || !twistUserID) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ async function run(): Promise<void> {
function createAuthorToTwistMap(input: string): { [id: string]: number } {
const mapping: { [id: string]: number } = {}

if (!input) {
return mapping
}

for (const individual of input.split(',')) {
const [username, twistUserID] = individual.split(':')

Expand Down

0 comments on commit fcebb5c

Please sign in to comment.