Skip to content

Commit

Permalink
fix: optional chaining to prevent undefined token
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyotato committed Mar 26, 2024
1 parent 4aeee89 commit 85362e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/roadmap/create/components/panel/PanelControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import {
IconSitemap,
IconX,
} from '@tabler/icons-react';
import { useRouter } from 'next/navigation';
import { JWT } from 'next-auth/jwt';
import { useSession } from 'next-auth/react';
import { useRouter } from 'next/navigation';
import {
Dispatch,
SetStateAction,
Expand Down Expand Up @@ -82,7 +82,7 @@ const PanelItem = ({

useMemo(() => {
const aToken = token as unknown as JWT;
setAccessToken(aToken.token);
setAccessToken(aToken?.token);
}, [token]);

useMemo(() => {
Expand Down

0 comments on commit 85362e2

Please sign in to comment.