Skip to content

Commit

Permalink
Skips assets with missing config file
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Oct 28, 2023
1 parent 8b3df12 commit 164c0c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/assetsUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ export function loadAssets(): AdvantageScopeAssets {
let isRobot = object.name.startsWith("Robot_");
let isJoystick = object.name.startsWith("Joystick_");

let configRaw = jsonfile.readFileSync(path.join(parentFolder, object.name, "config.json")) as unknown;
let configPath = path.join(parentFolder, object.name, "config.json");
if (!fs.existsSync(configPath)) return;
let configRaw = jsonfile.readFileSync(configPath) as unknown;
if (configRaw === null || typeof configRaw !== "object") return;

if (isField2d) {
Expand Down

0 comments on commit 164c0c5

Please sign in to comment.