Cleanup: Use optional chaining in a couple of places

This commit is contained in:
Henry Mercer 2022-07-12 16:30:21 +01:00
parent b316baae94
commit b45ac1f8f8
3 changed files with 5 additions and 5 deletions

4
lib/analyze-action.js generated
View file

@ -145,7 +145,7 @@ async function run() {
return;
}
finally {
if (config !== undefined && config.debugMode) {
if (config === null || config === void 0 ? void 0 : config.debugMode) {
try {
// Upload the database bundles as an Actions artifact for debugging
const toUpload = [];
@ -158,7 +158,7 @@ async function run() {
console.log(`Failed to upload database debug bundles: ${error}`);
}
}
if (config !== undefined && config.debugMode) {
if (config === null || config === void 0 ? void 0 : config.debugMode) {
core.info("Debug mode is on. Printing CodeQL debug logs...");
for (const language of config.languages) {
const databaseDirectory = util.getCodeQLDatabasePath(config, language);

File diff suppressed because one or more lines are too long

View file

@ -236,7 +236,7 @@ async function run() {
return;
} finally {
if (config !== undefined && config.debugMode) {
if (config?.debugMode) {
try {
// Upload the database bundles as an Actions artifact for debugging
const toUpload: string[] = [];
@ -260,7 +260,7 @@ async function run() {
}
}
if (config !== undefined && config.debugMode) {
if (config?.debugMode) {
core.info("Debug mode is on. Printing CodeQL debug logs...");
for (const language of config.languages) {
const databaseDirectory = util.getCodeQLDatabasePath(config, language);