Skip to content

Commit

Permalink
fix(config): prevent error when a config file is completely empty
Browse files Browse the repository at this point in the history
  • Loading branch information
umbopepato committed Apr 2, 2021
1 parent a931a84 commit 83f1bf9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/validate_config_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export function validateConfigData(configData: ConfigData | null): ConfigData {
throw new ValidationError("No scripts file found.");
}
if (
!configData.config.scripts ||
Object.entries(configData.config.scripts).length < 1
!configData.config?.scripts ||
Object.entries(configData.config?.scripts).length < 1
) {
log.warning(
"No scripts available.\nSee https://velociraptor.run for guidance on how to create scripts.",
Expand Down

0 comments on commit 83f1bf9

Please sign in to comment.