From c2ec878a5ba2b8e25674be3ca94a04b932e7c2ba Mon Sep 17 00:00:00 2001
From: Peter Reischig <peter.reischig@esrf.fr>
Date: Fri, 29 Mar 2013 19:44:31 +0100
Subject: [PATCH] Minor bug fix and addition to gtINDEXCreateInputData.

Signed-off-by: Peter Reischig <peter.reischig@esrf.fr>
---
 zUtil_Indexter/gtINDEXCreateInputData.m | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/zUtil_Indexter/gtINDEXCreateInputData.m b/zUtil_Indexter/gtINDEXCreateInputData.m
index 3f131b3b..cf5a0b9e 100644
--- a/zUtil_Indexter/gtINDEXCreateInputData.m
+++ b/zUtil_Indexter/gtINDEXCreateInputData.m
@@ -155,6 +155,10 @@ for ii = 1:nof_refs
         
         % Find hkl families that are close
         tot.hklind{ii} = find(abs(tot.theta(ii) - cryst.theta) <= toltheta);
+
+        if isempty(tot.hklind{ii})
+            error('No {hkl} family found for pair #%d',tot.pairid(ii))
+        end
         
         if length(tot.hklind{ii})==1
             tot.hkl(ii,:)  = cryst.hkl(:,tot.hklind{ii});
@@ -246,6 +250,7 @@ tot.Rline    = Rline;
 tot.Rhklind  = Rhklind;
 tot.Rshklind = Rshklind;
 
+tot.indexed = false(size(tot.pairid));
 
 %%%%%%%%%%%%%%%%%%%%%%%%
 %% Save data
-- 
GitLab