core: fix api projection

This commit is contained in:
undefined committed 2025-04-29 22:12:15 +08:00
1 parent 6e16d03f67
commit d6865d86e5
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -126,7 +126,7 @@ export class ApiService extends Service {
await emitHook?.(`api/before/${callOrName}`, args);
}
const result = await func(context, args as any);
return project ? projection(result, project) : result;
return (project && typeof result === 'object' && result !== null) ? projection(result, project) : result;
}
}