Skip to content

Commit 024f71c

Browse files
committed
adds error check
1 parent c1d1ef6 commit 024f71c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/UmbracoExamine.PDF/PdfIndexValueSetBuilder.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ public IEnumerable<ValueSet> GetValueSets(params IMedia[] content)
3232
var umbracoFile = item.GetValue<string>(Constants.Conventions.Media.File);
3333
if (string.IsNullOrWhiteSpace(umbracoFile)) continue;
3434

35-
var fileTextContent = ExtractTextFromFile(umbracoFile);
35+
string fileTextContent;
36+
try
37+
{
38+
fileTextContent = ExtractTextFromFile(umbracoFile);
39+
}
40+
catch (Exception ex)
41+
{
42+
_logger.Error<PdfIndexValueSetBuilder>(ex, "Could not read the file {MediaFile}", umbracoFile);
43+
continue;
44+
}
3645
var indexValues = new Dictionary<string, object>
3746
{
3847
["nodeName"] = item.Name,

0 commit comments

Comments
 (0)