Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit e737099

Browse files
authored
Merge pull request #173 from ptomato/fix-gcov-command
Fix broken gcov command
2 parents 7d9af78 + 764a681 commit e737099

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/codecov.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,9 @@ var upload = function(args, on_success, on_failure) {
577577
}
578578

579579
function sanitizeVar(arg) {
580+
if (!arg) {
581+
return ''
582+
}
580583
return arg.replace(/&/g, '')
581584
}
582585

test/index.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,4 +294,10 @@ describe('Codecov', function() {
294294
'real run unsafe command'
295295
)
296296
})
297+
298+
it('gracefully sanitizes undefined', function() {
299+
expect(function() {
300+
codecov.sanitizeVar(undefined)
301+
}).not.toThrow()
302+
})
297303
})

0 commit comments

Comments
 (0)