From d2d9dbe35a04b06718913eb9cc3038cd7674f324 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 21 Nov 2024 10:59:01 +0100 Subject: [PATCH] config: do not crash if we do not have an EOS imageformat in the list seen with Canon EOS M10 --- camlibs/ptp2/config.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c index 6e580a157..8e5f831cb 100644 --- a/camlibs/ptp2/config.c +++ b/camlibs/ptp2/config.c @@ -12321,7 +12321,10 @@ camera_lookup_by_property(Camera *camera, PTPDevicePropDesc *dpd, char **name, c case GP_WIDGET_TEXT: { char *val; CR (gp_widget_get_value (widget, &val)); - C_MEM (*content = strdup(val)); + if (val != NULL) + C_MEM (*content = strdup(val)); + else + C_MEM (*content = strdup("")); break; } case GP_WIDGET_RANGE: {