Skip to content

Commit

Permalink
Merge pull request #50 from mharju/master
Browse files Browse the repository at this point in the history
Fixed crash on invalid content on a file with supported extension
  • Loading branch information
StephaneDelcroix committed Sep 9, 2014
2 parents 2a3f777 + 9e1241c commit 4078b12
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Vernacular.Tool/Vernacular.Parsers/AggregateParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,18 @@ public override void Add (Stream stream, string path)
if (path == null)
throw new NotSupportedException ();

foreach (var parser_for_extension in
from parser in parsers
from ext in parser.SupportedFileExtensions
where ext == Path.GetExtension (path)
select parser) {
parser_for_extension.Add (stream, path);
try {
foreach (var parser_for_extension in
from parser in parsers
from ext in parser.SupportedFileExtensions
where ext == Path.GetExtension (path)
select parser) {
parser_for_extension.Add (stream, path);
};
} catch(Exception) {
// Ignore exceptions that are caused by supported file extensions
// not conforming to the actual expected format
return;
}
}

Expand Down

0 comments on commit 4078b12

Please sign in to comment.