Skip to content

Commit

Permalink
fix for undefined userId (#17117)
Browse files Browse the repository at this point in the history
Co-authored-by: jo.wijnant <[email protected]>
(cherry picked from commit c9c669d)
  • Loading branch information
wijnanjo authored and eschutho committed Nov 23, 2021
1 parent b577773 commit 6f932f9
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 6f932f9

Please sign in to comment.