Commit 4982f400 authored by nanahira's avatar nanahira

fix edge blank metadata case

parent b1e5696c
......@@ -90,6 +90,9 @@ export function DefinePlugin<T = any>(
const injectKeys = reflector.getArray(KoishiSystemInjectSymKeys, this);
for (const key of injectKeys) {
const valueFunction = reflector.get(KoishiSystemInjectSym, this, key);
if (!valueFunction) {
continue;
}
Object.defineProperty(this, key, {
configurable: true,
enumerable: true,
......@@ -102,6 +105,9 @@ export function DefinePlugin<T = any>(
const injectKeys = reflector.getArray(KoishiServiceInjectSymKeys, this);
for (const key of injectKeys) {
const name = reflector.get(KoishiServiceInjectSym, this, key);
if (!name) {
continue;
}
Object.defineProperty(this, key, {
enumerable: true,
configurable: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment