Skip to content

Commit

Permalink
fix(plugin): fix allowAdditionalActionProperties config accessing
Browse files Browse the repository at this point in the history
The default config is not merged in at the time this function is first called so we manually
fallback on the default config
  • Loading branch information
fmauNeko committed Jan 13, 2025
1 parent c990417 commit 5fc8096
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/core/plugin/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const kerror = require("../../kerror");
const errorCodes = require("../../kerror/codes");
const Manifest = require("./pluginManifest");
const { has, isPlainObject } = require("../../util/safeObject");
const defaultConfig = require("../../config/default.config");

const assertionError = kerror.wrap("plugin", "assert");
const runtimeError = kerror.wrap("plugin", "runtime");
Expand Down Expand Up @@ -334,8 +335,9 @@ class Plugin {
definition.actions,
)) {
if (
!global.app.config.content.controllers.definition
.allowAdditionalActionProperties
!global.app.config.content.controllers?.definition
?.allowAdditionalActionProperties ??
defaultConfig.controllers.definition.allowAdditionalActionProperties
) {
const actionProperties = Object.keys(actionDefinition).filter(
(prop) => prop !== "handler" && prop !== "http",
Expand Down

0 comments on commit 5fc8096

Please sign in to comment.