From 940e057662516390eeab3a8306b630c6778da5b2 Mon Sep 17 00:00:00 2001
From: mbucknell <mbucknell@usgs.gov>
Date: Thu, 19 Aug 2021 16:27:50 -0500
Subject: [PATCH] Added check for empty IV period of record before determining
 if flood stages should be fetched.

---
 .../scripts/monitoring-location/components/hydrograph/index.js  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/index.js b/assets/src/scripts/monitoring-location/components/hydrograph/index.js
index 0a93f41a4..43d7a814e 100644
--- a/assets/src/scripts/monitoring-location/components/hydrograph/index.js
+++ b/assets/src/scripts/monitoring-location/components/hydrograph/index.js
@@ -103,7 +103,7 @@ export const attachToNode = function(store,
 
     let fetchDataPromises = [fetchHydrographDataPromise];
     // Fetch waterwatch flood levels
-    if (config.GAGE_HEIGHT_PARAMETER_CODE in config.ivPeriodOfRecord) {
+    if (config.ivPeriodOfRecord && config.GAGE_HEIGHT_PARAMETER_CODE in config.ivPeriodOfRecord) {
         const fetchFloodLevelsPromise =  store.dispatch(floodDataActions.retrieveWaterwatchData(siteno));
         // If flood levels are to be shown then wait to render the hydrograph until those have been fetched.
         if (parameterCode === config.GAGE_HEIGHT_PARAMETER_CODE) {
-- 
GitLab