From 298da03e2f3acadcbdb7ddad4dc739b70fe4d817 Mon Sep 17 00:00:00 2001 From: dannyrb Date: Mon, 24 Feb 2020 11:22:41 -0500 Subject: [PATCH] chore: handle function not set (preserve non-breaking) --- platform/viewer/src/connectedComponents/ToolbarRow.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/viewer/src/connectedComponents/ToolbarRow.js b/platform/viewer/src/connectedComponents/ToolbarRow.js index 2dca5835f..f7b9841b9 100644 --- a/platform/viewer/src/connectedComponents/ToolbarRow.js +++ b/platform/viewer/src/connectedComponents/ToolbarRow.js @@ -74,7 +74,9 @@ class ToolbarRow extends Component { // It's a bit beefy to pass studies; probably only need to be reactive on `studyInstanceUIDs` and activeViewport? // Note: This does not cleanly handle `studies` prop updating with panel open - const isDisabled = menuOption.isDisabled(this.props.studies); + const isDisabled = + typeof menuOption.isDisabled === 'function' && + menuOption.isDisabled(this.props.studies); if (hasActiveContext && !isDisabled) { const menuOptionEntry = {