codeql-action icon indicating copy to clipboard operation
codeql-action copied to clipboard

Improve error message when the YAML config file is empty

Open adityasharad opened this issue 4 years ago • 0 comments

Using the Runner with --config-file <path to an empty file> leads to the following error. Looking at the code I expect the same applies to the Action. This is admittedly an unusual case, but it has appeared in at least one support request, so we should provide a more helpful warning and carry on, rather than crashing.

TypeError: Cannot use 'in' operator to search for 'name' in undefined
    at loadConfig (/snapshot/dist/codeql-runner.js)
    at Object.initConfig (/snapshot/dist/codeql-runner.js)
    at Object.initConfig (/snapshot/dist/codeql-runner.js)
    at Command.<anonymous> (/snapshot/dist/codeql-runner.js)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

adityasharad avatar Sep 03 '21 17:09 adityasharad