Skip to content

Commit

Permalink
Add null check for authState
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Raible committed Aug 3, 2021
1 parent 1970eb8 commit 2c90198
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/add-auth/react-ts/src/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default withOktaAuth(class Home extends Component<HomeProps, HomeState> {

render() {
let body = null;
if (this.props.authState.isAuthenticated) {
if (this.props.authState?.isAuthenticated) {
body = (
<div className="Buttons">
<button onClick={this.logout}>Logout</button>
Expand Down
2 changes: 1 addition & 1 deletion src/add-auth/react/src/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default withOktaAuth(class Home extends Component {

render() {
let body = null;
if (this.props.authState.isAuthenticated) {
if (this.props.authState?.isAuthenticated) {
body = (
<div className="Buttons">
<button onClick={this.logout}>Logout</button>
Expand Down

0 comments on commit 2c90198

Please sign in to comment.