Skip to content

Commit ed17fed

Browse files
committed
fix for silly mistake
Signed-off-by: Neil South <[email protected]>
1 parent 2045f5e commit ed17fed

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/TaskManager/Plug-ins/Email/EmailPlugin.cs

+15-7
Original file line numberDiff line numberDiff line change
@@ -178,22 +178,30 @@ private async Task<Dictionary<string, List<string>>> AddRawMetaFromFile(Dictiona
178178

179179
foreach (var item in _includeMetadata)
180180
{
181-
var values = new List<string>();
182-
if (metadata.ContainsKey(item)) values = metadata[item];
183-
184-
DicomTag tag;
181+
DicomTag? tag = null;
185182
try
186183
{
187184
tag = DicomDictionary.Default[item];
188185
}
189186
catch (Exception)
190187
{
191-
tag = DicomTag.Parse(item);
188+
try
189+
{
190+
tag = DicomTag.Parse(item);
191+
}
192+
catch (Exception) { }
192193
}
193194
if (tag is not null)
194195
{
195-
values.Add(dcmFile.Dataset.GetString(tag).Trim());
196-
metadata.Add(item, values);
196+
var value = dcmFile.Dataset.GetString(tag).Trim();
197+
if (metadata.ContainsKey(item))
198+
{
199+
metadata[item].Add(value);
200+
}
201+
else
202+
{
203+
metadata.Add(item, new List<string> { value });
204+
};
197205
}
198206
}
199207
}

0 commit comments

Comments
 (0)