From f34bc8edcd96abcf3fea78bf834a460a0e81c26a Mon Sep 17 00:00:00 2001
From: Dan Nixon <dan@dan-nixon.com>
Date: Tue, 25 Nov 2014 14:20:58 +0000
Subject: [PATCH] Add validation to single fit options

Refs #10626
---
 Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp | 4 ++++
 Code/Mantid/MantidQt/CustomInterfaces/src/FuryFit.cpp | 3 +++
 Code/Mantid/MantidQt/CustomInterfaces/src/MSDFit.cpp  | 3 +++
 3 files changed, 10 insertions(+)

diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp
index b7aea42f698..a809b08ff20 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp
@@ -146,6 +146,7 @@ namespace IDA
   {
     if ( m_cfInputWS == NULL )
     {
+      g_log.error("No workspace loaded");
       return;
     }
 
@@ -774,6 +775,9 @@ namespace IDA
 
   void ConvFit::singleFit()
   {
+    if(!validate())
+      return;
+
     plotInput();
 
     if ( m_curves["CFDataCurve"] == NULL )
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/FuryFit.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/FuryFit.cpp
index 4b82337600e..f91a98cf064 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/FuryFit.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/FuryFit.cpp
@@ -526,6 +526,9 @@ namespace IDA
 
   void FuryFit::singleFit()
   {
+    if(!validate())
+      return;
+
     // First create the function
     auto function = createFunction();
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MSDFit.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MSDFit.cpp
index cd8ce5d0ecb..ce237e0b43c 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/MSDFit.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MSDFit.cpp
@@ -88,6 +88,9 @@ namespace IDA
 
   void MSDFit::singleFit()
   {
+    if(!validate())
+      return;
+
     QString pyInput =
       "from IndirectDataAnalysis import msdfit\n"
       "startX = " + QString::number(m_dblManager->value(m_properties["Start"])) +"\n"
-- 
GitLab