Skip to content

Commit

Permalink
Merge pull request #99 from Canas/fix-arn-undefined-error
Browse files Browse the repository at this point in the history
fix: gracefully handle logName on undefined Arn
  • Loading branch information
subinataws authored Jul 13, 2022
2 parents 208ba49 + f7983ad commit 95cc38b
Show file tree
Hide file tree
Showing 3 changed files with 288,680 additions and 58,694 deletions.
23 changes: 14 additions & 9 deletions code-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,18 @@ function buildSdk() {
}

function logName(Arn) {
const [logGroupName, logStreamName] = Arn.split(":log-group:")
.pop()
.split(":log-stream:");
if (logGroupName === "null" || logStreamName === "null")
return {
logGroupName: undefined,
logStreamName: undefined,
};
return { logGroupName, logStreamName };
const logs = {
logGroupName: undefined,
logStreamName: undefined,
};
if (Arn) {
const [logGroupName, logStreamName] = Arn.split(":log-group:")
.pop()
.split(":log-stream:");
if (logGroupName !== "null" && logStreamName !== "null") {
logs.logGroupName = logGroupName;
logs.logStreamName = logStreamName;
}
}
return logs;
}
Loading

0 comments on commit 95cc38b

Please sign in to comment.