diff --git a/GUI/View/Import/RealDataMaskWidget.cpp b/GUI/View/Import/RealDataMaskWidget.cpp
index 8b4b52de4d170d3cadafeef11b553accf0c882e1..88c516591e44bd784a166f3a3877bfb11d4f329c 100644
--- a/GUI/View/Import/RealDataMaskWidget.cpp
+++ b/GUI/View/Import/RealDataMaskWidget.cpp
@@ -77,6 +77,8 @@ QList<QAction*> RealDataMaskWidget::actionList()
 
 void RealDataMaskWidget::setContext()
 {
+    ASSERT(currentIntensityDataItem());
+
     MaskContainerItem* containerItem = currentIntensityDataItem()->getOrCreateMaskContainerItem();
     QModelIndex maskContainerIndex = containerItem->index();
     SessionModel* model = currentIntensityDataItem()->model();
@@ -103,7 +105,8 @@ void RealDataMaskWidget::resetContext()
 
 void RealDataMaskWidget::showEvent(QShowEvent*)
 {
-    setContext();
+    if (currentIntensityDataItem())
+        setContext();
 }
 
 void RealDataMaskWidget::hideEvent(QHideEvent*)
diff --git a/GUI/View/Projection/IntensityDataProjectionsWidget.cpp b/GUI/View/Projection/IntensityDataProjectionsWidget.cpp
index e96466a8eeafabd9a2c5015a9be683f3e5d47653..40e015901f6d2aa7f518ba6b312f3c1122482f55 100644
--- a/GUI/View/Projection/IntensityDataProjectionsWidget.cpp
+++ b/GUI/View/Projection/IntensityDataProjectionsWidget.cpp
@@ -63,6 +63,8 @@ void IntensityDataProjectionsWidget::setJobOrRealItem(JobRealBase* job_or_real_i
 
 void IntensityDataProjectionsWidget::setContext()
 {
+    ASSERT(currentIntensityDataItem());
+
     ProjectionContainerItem* container =
         currentIntensityDataItem()->getOrCreateProjectionContainerItem();
     QModelIndex shapeContainerIndex = container->index();
@@ -89,7 +91,8 @@ void IntensityDataProjectionsWidget::resetContext()
 
 void IntensityDataProjectionsWidget::showEvent(QShowEvent*)
 {
-    setContext();
+    if (currentIntensityDataItem())
+        setContext();
 }
 
 void IntensityDataProjectionsWidget::hideEvent(QHideEvent*)