Skip to content

Commit db505f1

Browse files
authored
Merge pull request #608 from wpferguson/fix_metadata_string_substitution
lib/dtutils/string - image metadata may return a nil so check to
2 parents 4d54b5e + 57d15a3 commit db505f1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/dtutils/string.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ function dtutils_string.build_substitute_list(image, sequence, variable_string,
770770
image.id, -- ID
771771
image.duplicate_index, -- VERSION
772772
version_multi, -- VERSION.IF_MULTI
773-
image.version_name, -- VERSION.NAME
773+
image.version_name and image.version_name or "", -- VERSION.NAME
774774
dt.configuration.version, -- DARKTABLE.VERSION
775775
"", -- DARKTABLE.NAME
776776
string.format("%04d", sequence), -- SEQUENCE
@@ -836,11 +836,11 @@ function dtutils_string.build_substitute_list(image, sequence, variable_string,
836836
"", -- RATING.ICONS - wont be implemented
837837
labels, -- LABELS
838838
"", -- LABELS.ICONS - wont be implemented
839-
image.title, -- TITLE
840-
image.description, -- DESCRIPTION
841-
image.creator, -- CREATOR
842-
image.publisher, -- PUBLISHER
843-
image.rights, -- RIGHTS
839+
image.title and image.title or "", -- TITLE
840+
image.description and image.description or "", -- DESCRIPTION
841+
image.creator and image.creator or "", -- CREATOR
842+
image.publisher and image.publisher or "", -- PUBLISHER
843+
image.rights and image.rights or "", -- RIGHTS
844844
"", -- TAGS - wont be implemented
845845
"", -- SIDECAR.TXT - wont be implemented
846846
pictures_folder, -- FOLDER.PICTURES

0 commit comments

Comments
 (0)