Skip to content

Commit

Permalink
fix for undefined userId (apache#17117)
Browse files Browse the repository at this point in the history
Co-authored-by: jo.wijnant <[email protected]>
  • Loading branch information
2 people authored and Emmanuel Bavoux committed Nov 14, 2021
1 parent a4d6a70 commit 964bab8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion superset-frontend/src/views/CRUD/chart/ChartList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function ChartList(props: ChartListProps) {
const [preparingExport, setPreparingExport] = useState<boolean>(false);

const { userId } = props.user;
const userKey = getFromLocalStorage(userId.toString(), null);
const userKey = getFromLocalStorage(userId?.toString(), null);

const openChartImportModal = () => {
showImportModal(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function DashboardList(props: DashboardListProps) {
};

const { userId } = props.user;
const userKey = getFromLocalStorage(userId.toString(), null);
const userKey = getFromLocalStorage(userId?.toString(), null);

const canCreate = hasPerm('can_write');
const canEdit = hasPerm('can_write');
Expand Down

0 comments on commit 964bab8

Please sign in to comment.