From f31f8493441080b59af3ad66a230af7fac4a6c39 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Fri, 2 Jun 2023 10:52:41 -0400 Subject: [PATCH] Fix panic removing terminator with invalid session. Fixes #1512 --- controller/handler_edge_ctrl/common.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/controller/handler_edge_ctrl/common.go b/controller/handler_edge_ctrl/common.go index a793552cf..e8a325f6e 100644 --- a/controller/handler_edge_ctrl/common.go +++ b/controller/handler_edge_ctrl/common.go @@ -122,8 +122,12 @@ func (self *baseSessionRequestContext) newChangeContext() *change.Context { if self.session != nil { result. SetChangeAuthorType(change.AuthorTypeIdentity). - SetChangeAuthorId(self.session.IdentityId). - SetChangeAuthorName(self.apiSession.Identity.Name) + SetChangeAuthorId(self.session.IdentityId) + if self.apiSession != nil && self.apiSession.Identity != nil { + result.SetChangeAuthorName(self.apiSession.Identity.Name) + } else if authorIdentity, _ := self.handler.getAppEnv().Managers.Identity.Read(self.session.IdentityId); authorIdentity != nil { + result.SetChangeAuthorName(authorIdentity.Name) + } } else if self.sourceRouter != nil { result. SetChangeAuthorType(change.AuthorTypeRouter).