fix crashes if no faceplate selected
Warning, cannot access the index:
_darcs/index: opening of '_darcs/index' failed: permission denied (Permission denied)
diff -rN -u old-DM2K/dm2kApp/dm2k/faceplateBase.c new-DM2K/dm2kApp/dm2k/faceplateBase.c
--- old-DM2K/dm2kApp/dm2k/faceplateBase.c 2022-06-25 22:36:12.736506985 +0200
+++ new-DM2K/dm2kApp/dm2k/faceplateBase.c 2022-06-25 22:36:12.736506985 +0200
@@ -348,7 +348,8 @@
if (fpg == NULL
|| fpg->entries == NULL
|| num >= fpg->entriesNum
- || fpg->entries[num] == NULL)
+ || fpg->entries[num] == NULL
+ || num < 0 )
return;
freeFaceplate(fpg->entries[num]);
diff -rN -u old-DM2K/dm2kApp/dm2k/faceplateGUICallback.c new-DM2K/dm2kApp/dm2k/faceplateGUICallback.c
--- old-DM2K/dm2kApp/dm2k/faceplateGUICallback.c 2022-06-25 22:36:12.736506985 +0200
+++ new-DM2K/dm2kApp/dm2k/faceplateGUICallback.c 2022-06-25 22:36:12.736506985 +0200
@@ -788,9 +788,9 @@
break;
case FP_FACEPLATE_APPLY:
- getFaceplateFromWidgets(fGUI, fGUI->fpg->entries[fGUI->current]);
+ if(fGUI != NULL && fGUI->current >= 0)
+ getFaceplateFromWidgets(fGUI, fGUI->fpg->entries[fGUI->current]);
break;
-
case FP_FACEPLATE_DELETE: {
WidgetList wList;
int numWidgets;
patch bc88e19fc005c548387caa2a0e3f82d0261f1a4a
Author: christoph.schroeder@helmholtz-berlin.de
Date: Tue Oct 23 11:01:41 CEST 2018
* fix crashes if no faceplate selecte