Fixed crash when no event to display

This commit is contained in:
keplyx 2020-03-11 19:55:20 +01:00
parent d17a52307f
commit 30c1c9c5bf

View file

@ -10,7 +10,7 @@ import PlanningEventManager from "../utils/PlanningEventManager";
function PreviewEventDashboardItem(props) { function PreviewEventDashboardItem(props) {
const {colors} = props.theme; const {colors} = props.theme;
const isEmpty = PlanningEventManager.isDescriptionEmpty(props.event['description']); const isEmpty = props.event === undefined ? true : PlanningEventManager.isDescriptionEmpty(props.event['description']);
if (props.event !== undefined && props.event !== null) { if (props.event !== undefined && props.event !== null) {
const hasImage = props.event['logo'] !== '' && props.event['logo'] !== null; const hasImage = props.event['logo'] !== '' && props.event['logo'] !== null;
const getImage = () => <Avatar.Image const getImage = () => <Avatar.Image