Skip to content

Commit a2df272

Browse files
Merge pull request #64 from Onboardbase/post-sdk-updates
fix: null bug in scanners
2 parents 356de69 + b3f17fd commit a2df272

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "securelog-scan",
3-
"version": "3.0.14",
3+
"version": "3.0.15",
44
"description": "A CLI tool to scan codebases for potential secrets.",
55
"main": "dist/index.js",
66
"author": {

src/fileScanner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const processPossibleSecretsInString = async (
5454
detectors.map(async (detector) => {
5555
const { scan } = detector;
5656
const scanResponse = await scan(false, rawValue);
57-
if (scanResponse) {
57+
if (scanResponse && scanResponse.rawValue) {
5858
modifiedValue = modifiedValue.replaceAll(
5959
scanResponse.rawValue as string,
6060
maskString(scanResponse.rawValue as string, {
@@ -96,7 +96,7 @@ const processPossibleSecrets = async (
9696
detectors.map(async (detector) => {
9797
const { scan } = detector;
9898
const scanResponse = await scan(verify, trimmedFile);
99-
if (scanResponse) {
99+
if (scanResponse && scanResponse.rawValue) {
100100
const line = scanResponse.position
101101
? getLineNumber(trimmedFile, scanResponse.position)
102102
: 1;

src/gitScanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const scanLineForSecrets = async (
5757
const { scan } = detector;
5858
const scanResponse = await scan(verify, line);
5959

60-
if (scanResponse) {
60+
if (scanResponse && scanResponse.rawValue) {
6161
EventManager.emitNewSecret({
6262
...scanResponse,
6363
filePath,

src/shared/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const redactSensitiveData = async (options: ScanStringOptions) => {
1616
detectors.map(async (detector) => {
1717
const { scan } = detector;
1818
const scanResponse = await scan(false, options.rawValue as string);
19-
if (scanResponse) {
19+
if (scanResponse && scanResponse.rawValue) {
2020
modifiedValue = modifiedValue?.replaceAll(
2121
scanResponse.rawValue as string,
2222
maskString(scanResponse.rawValue as string, {
@@ -40,7 +40,7 @@ export const scanStringAndReturnJson = async (options: ScanStringOptions) => {
4040
detectors.map(async (detector) => {
4141
const { scan } = detector;
4242
const scanResponse = await scan(false, options.rawValue as string);
43-
if (scanResponse) {
43+
if (scanResponse && scanResponse.rawValue) {
4444
return scanResponse;
4545
}
4646
})

0 commit comments

Comments
 (0)