mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 17:26:29 -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
|
||||
*/
|
||||
|
@ -41,6 +41,11 @@ export const MarkdownBody = createParamDecorator(
|
|||
},
|
||||
[
|
||||
(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(
|
||||
target,
|
||||
key,
|
||||
|
|
Loading…
Reference in a new issue