Skip to content

Commit 16c2b24

Browse files
authored
fix(tickets): single ticket ui crash
1 parent 14b95b5 commit 16c2b24

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/client/containers/Tickets/SingleTicketContainer.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,13 @@ class SingleTicketContainer extends React.Component {
275275
// Perms
276276
const hasTicketUpdate = this.ticket && this.ticket.status !== 3 && helpers.canUser('tickets:update')
277277
const hasTicketStatusUpdate = () => {
278-
const isAgent = this.props.sessionUser.role.isAgent
279-
const isAdmin = this.props.sessionUser.role.isAdmin
278+
const isAgent = this.props.sessionUser ? this.props.sessionUser.role.isAgent : false
279+
const isAdmin = this.props.sessionUser ? this.props.sessionUser.role.isAdmin : false
280280
if (isAgent || isAdmin) {
281281
return helpers.canUser('tickets:update')
282282
} else {
283-
if (!this.ticket) return false
284-
return helpers.hasPermOverRole(this.ticket.owner.role, this.sessionUser.role, 'tickets:update', false)
283+
if (!this.ticket || !this.props.sessionUser) return false
284+
return helpers.hasPermOverRole(this.ticket.owner.role, this.props.sessionUser.role, 'tickets:update', false)
285285
}
286286
}
287287

0 commit comments

Comments
 (0)