Revision: 71494
          http://sourceforge.net/p/brlcad/code/71494
Author:   starseeker
Date:     2018-08-11 15:40:34 +0000 (Sat, 11 Aug 2018)
Log Message:
-----------
Only try to exec if a callback is actually set

Modified Paths:
--------------
    brlcad/trunk/src/librt/search.c

Modified: brlcad/trunk/src/librt/search.c
===================================================================
--- brlcad/trunk/src/librt/search.c     2018-08-11 15:33:35 UTC (rev 71493)
+++ brlcad/trunk/src/librt/search.c     2018-08-11 15:40:34 UTC (rev 71494)
@@ -1272,7 +1272,12 @@
        plan->p_un.ex._e_argv[plan->p_un.ex._e_holes[i]] = name;
     }
 
-    ret = (*plan->p_un.ex._e_callback)(plan->p_un.ex._e_argc, (const 
char**)plan->p_un.ex._e_argv, plan->p_un.ex._e_userdata);
+    /* Only try to exec if we actually have a callback */
+    if (plan->p_un.ex._e_callback) {
+       ret = (*plan->p_un.ex._e_callback)(plan->p_un.ex._e_argc, (const 
char**)plan->p_un.ex._e_argv, plan->p_un.ex._e_userdata);
+    } else {
+       ret = 1;
+    }
 
     if (!(db_node->flags & DB_SEARCH_RETURN_UNIQ_DP)) {
        bu_free(name, "f_exec string");

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to