Skip to content

Commit

Permalink
fix(webserver): Add return after failing to load OpenAPI spec (#1689)
Browse files Browse the repository at this point in the history
The `spec` variable is being used after the spec fails to load, which causes a TypeError
  • Loading branch information
alufers committed Jan 14, 2023
1 parent e2987e0 commit b37fb09
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions backend/lib/webserver/WebServer.js
Expand Up @@ -245,6 +245,7 @@ class WebServer {
spec = JSON.parse(fs.readFileSync(path.join(__dirname, "../res/valetudo.openapi.schema.json")).toString());
} catch (e) {
Logger.warn("Failed to load OpenApi spec. Swagger endpoint and payload validation will be unavailable.", e.message);
return;
}


Expand Down

0 comments on commit b37fb09

Please sign in to comment.