From c07a7c1c201703b6e6f1193eeccc703d07d1efe5 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 1 Oct 2024 20:04:33 +0200 Subject: [PATCH] config: set default value to a string only if we have a string widget (AFL) --- camlibs/ptp2/config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c index 53ec6c318..383f5bb5c 100644 --- a/camlibs/ptp2/config.c +++ b/camlibs/ptp2/config.c @@ -11951,7 +11951,9 @@ _get_config (Camera *camera, const char *confname, CameraWidget **outwidget, Cam X(PTP_DTC_UINT64,u64,"%ld") #undef X case PTP_DTC_STR: - gp_widget_set_value (widget, dpd.CurrentValue.str); + /* only set string if we have a string based widget */ + if ((type == GP_WIDGET_TEXT) || (type == GP_WIDGET_MENU) || (type == GP_WIDGET_RADIO)) + gp_widget_set_value (widget, dpd.CurrentValue.str); break; default: break;