dthelp: Further coverity fixes
[oweals/cde.git] / cde / programs / dthelp / dthelpview / Util.c
index 36dc856161af2b4f95f46f9d8d598894dfe000b6..b5608d9750bc5e96b607fb25bffa60ce0954f2cd 100644 (file)
@@ -166,13 +166,16 @@ void CloseHelpCB (
   pTemp = pCacheListHead;
   
   /* Search our Cache List for the closed help dialog */
-  while ((pTemp->helpDialog != helpDialog) && (pTemp != NULL))
+  while ((pTemp != NULL) && (pTemp->helpDialog != helpDialog))
      pTemp = pTemp->pNext;
  
 
-  if (pTemp == NULL)
+  if (pTemp == NULL) {
     /* ERROR */
     printf("We did not find our help dialog widget in the cache list??? /n");
+    /* TODO what error handling here? */
+    return;
+  }
 
   /* Un Map and Clean up the help widget */
   XtUnmanageChild(helpDialog);