[dasher] Replace if(NULL)return with asserts



commit 92e07ca59018d82068aad829bc3d1dfadee02ac1
Author: Patrick Welche <prlw1 cam ac uk>
Date:   Fri Feb 1 18:43:46 2013 +0000

    Replace if(NULL)return with asserts
    
    This so called "defensive programming" makes bug hunting much
    harder.

 Src/DasherCore/DasherInterfaceBase.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/Src/DasherCore/DasherInterfaceBase.cpp b/Src/DasherCore/DasherInterfaceBase.cpp
index 331ff9d..c4bcd2d 100644
--- a/Src/DasherCore/DasherInterfaceBase.cpp
+++ b/Src/DasherCore/DasherInterfaceBase.cpp
@@ -816,12 +816,12 @@ void CDasherInterfaceBase::GetPermittedValues(int iParameter, std::vector<std::s
   // TODO: Deprecate direct calls to these functions
   switch (iParameter) {
   case SP_ALPHABET_ID:
-    if(m_AlphIO)
-      m_AlphIO->GetAlphabets(&vList);
+    DASHER_ASSERT(m_AlphIO != NULL);
+    m_AlphIO->GetAlphabets(&vList);
     break;
   case SP_COLOUR_ID:
-    if(m_ColourIO)
-      m_ColourIO->GetColours(&vList);
+    DASHER_ASSERT(m_ColourIO != NULL);
+    m_ColourIO->GetColours(&vList);
     break;
   case SP_INPUT_FILTER:
     m_oModuleManager.ListModules(1, vList);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]