--- \dll\iup\a\iup_layoutdlg.c	Fri Dec 20 14:52:32 2019
+++ iup_layoutdlg.c	Wed Jan 15 09:10:42 2020
@@ -126,12 +126,16 @@
 
   if (obj)
   {
-    int id = IupTreeGetId(tree, obj);
     IFnii cb = (IFnii)IupGetCallback(tree, "SELECTION_CB");
-    cb(tree, last_id, 0);
-    IupSetInt(tree, "VALUE", id);
-    cb(tree, id, 1);
 
+    if (cb)
+    {
+      int id = IupTreeGetId(tree, obj);
+
+      cb(tree, last_id, 0);
+      IupSetInt(tree, "VALUE", id);
+      cb(tree, id, 1);
+    }
     IupSetAttribute(lbl_result, "TITLE", "");
   }
   else
