From 48847ae479f60e8ce8a39aae780c1cfc7d1bf10d Mon Sep 17 00:00:00 2001 From: Deluan Date: Sat, 13 Feb 2021 12:04:02 -0500 Subject: [PATCH] Don't break if it tries to render ContextMenu without data. Fix #776 --- ui/src/common/ContextMenus.js | 46 ++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/ui/src/common/ContextMenus.js b/ui/src/common/ContextMenus.js index cddae1f08..650f52ffe 100644 --- a/ui/src/common/ContextMenus.js +++ b/ui/src/common/ContextMenus.js @@ -166,17 +166,18 @@ const ContextMenu = ({ ) } -export const AlbumContextMenu = (props) => ( - -) +export const AlbumContextMenu = (props) => + props.record ? ( + + ) : null AlbumContextMenu.propTypes = { record: PropTypes.object, @@ -190,17 +191,18 @@ AlbumContextMenu.defaultProps = { addLabel: true, } -export const ArtistContextMenu = (props) => ( - -) +export const ArtistContextMenu = (props) => + props.record ? ( + + ) : null ArtistContextMenu.propTypes = { record: PropTypes.object,