From 786b21d7d605748ca03124b48930c56f472533e7 Mon Sep 17 00:00:00 2001
From: Markus FRANK <Markus.Frank@cern.ch>
Date: Thu, 11 Feb 2021 09:33:25 +0100
Subject: [PATCH] Enable locking mechanism to switch unit system

---
 DDCond/src/ConditionsDependencyHandler.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/DDCond/src/ConditionsDependencyHandler.cpp b/DDCond/src/ConditionsDependencyHandler.cpp
index 8f332da2d..e210df43b 100644
--- a/DDCond/src/ConditionsDependencyHandler.cpp
+++ b/DDCond/src/ConditionsDependencyHandler.cpp
@@ -280,6 +280,18 @@ void ConditionsDependencyHandler::do_callback(Work* work)   {
       work->state = CREATED;
       ++num_callback;
     }
+    else   {
+      printout(ERROR,"ConditionDependency",
+	       "+++ Callback handler returned invalid condition.  Key:%s %c%s%c",
+	       work->context.dependency->target.toString().c_str(),
+#if defined(DD4HEP_CONDITIONS_DEBUG)
+	       '[',work->context.dependency->detector.path().c_str(),']'
+#else
+	       ' ',"",' '
+#endif
+	       );
+      throw std::runtime_error("Invalid derived condition callback");
+    }
     return;
   }
   catch(const std::exception& e)   {
-- 
GitLab