[core] Fix "Cannot read properties of undefined (reading 'isAdmin')"
fix #1969
This commit is contained in:
1 parent
3ca9545a58
commit
9f3c28b6ac
1 file changed
+1
-1
@@ -81,7 +81,7 @@ class SessionsController {
|
||||
@Req() req,
|
||||
): Promise<SessionInfo[]> {
|
||||
let sessions = await this.manager.getSessions(query.all);
|
||||
if (!req.user.isAdmin) {
|
||||
if (!req.user?.isAdmin) {
|
||||
sessions = FilterSessions(req.ability, Action.Read, sessions);
|
||||
}
|
||||
if (query.expand?.includes(SessionExpand.apps)) {
|
||||
|
||||
Reference in new issue
Block a user