From 03b12454f8af24b687442014362ea1b959e8fbba Mon Sep 17 00:00:00 2001 From: sameehj Date: Thu, 5 Aug 2021 14:27:04 +0300 Subject: [PATCH] updateImage: Don't assign DisplayName if it doesn't exist This commit resolves issue https://github.com/plotly/plotly-graphing-library-for-matlab/issues/283 --- plotly/plotlyfig_aux/handlegraphics/updateImage.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plotly/plotlyfig_aux/handlegraphics/updateImage.m b/plotly/plotlyfig_aux/handlegraphics/updateImage.m index 453c83c8..e9ebb313 100644 --- a/plotly/plotlyfig_aux/handlegraphics/updateImage.m +++ b/plotly/plotlyfig_aux/handlegraphics/updateImage.m @@ -92,8 +92,10 @@ %-------------------------------------------------------------------------% %-image name-% -obj.data{imageIndex}.name = image_data.DisplayName; - +if ~isempty(image_data.DisplayName); + obj.data{imageIndex}.name = image_data.DisplayName; +else + obj.data{imageIndex}.name = image_data.DisplayName; %-------------------------------------------------------------------------% %-image visible-%