mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -05:00
fix(backend): throw error if key in param decorator is not defined
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
ae58cab019
commit
15374acb93
1 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
@ -41,6 +41,11 @@ export const MarkdownBody = createParamDecorator(
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
(target, key): void => {
|
(target, key): void => {
|
||||||
|
if (key === undefined) {
|
||||||
|
throw new Error(
|
||||||
|
`Could not enhance param decorator for target ${target.toString()} because key is undefined`,
|
||||||
|
);
|
||||||
|
}
|
||||||
const ownPropertyDescriptor = Object.getOwnPropertyDescriptor(
|
const ownPropertyDescriptor = Object.getOwnPropertyDescriptor(
|
||||||
target,
|
target,
|
||||||
key,
|
key,
|
||||||
|
|
Loading…
Reference in a new issue