From d72bb0e1288bccd5bce21031c6782d6dd47f7f7e Mon Sep 17 00:00:00 2001
From: Raquel Alvarez Banos <raquel.alvarez.banos@gmail.com>
Date: Thu, 7 May 2015 15:28:14 +0100
Subject: [PATCH] Re #11711 Fix crash when data has not been set

---
 .../CustomInterfaces/src/Muon/ALCBaselineModellingModel.cpp     | 2 +-
 .../MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingModel.cpp  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingModel.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingModel.cpp
index 82684387ebe..7fd099cbf5d 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingModel.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingModel.cpp
@@ -96,7 +96,7 @@ namespace CustomInterfaces
 
   MatrixWorkspace_sptr ALCBaselineModellingModel::exportWorkspace()
   {
-    if ( m_data->getNumberHistograms() == 3 ) {
+    if ( m_data && m_data->getNumberHistograms() == 3 ) {
 
       // Export results only if data have been fit, that is,
       // if m_data has three histograms
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingModel.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingModel.cpp
index ae5cca0ba57..9992b244924 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingModel.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingModel.cpp
@@ -19,7 +19,7 @@ namespace CustomInterfaces
 
   MatrixWorkspace_sptr ALCPeakFittingModel::exportWorkspace()
   {
-    if ( m_data->getNumberHistograms() == 3 ) {
+    if ( m_data && m_data->getNumberHistograms() == 3 ) {
 
       return boost::const_pointer_cast<MatrixWorkspace>(m_data);
 
-- 
GitLab