Skip to content

Commit 80b0f20

Browse files
committed
Add FormatException case to Utf8ToString() catch
1 parent 073cb54 commit 80b0f20

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesReader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,10 @@ public override int GetOrd(int docId)
411411
SimpleTextUtil.ReadLine(_input, _scratch);
412412
try
413413
{
414-
// LUCNENENET: .NET doesn't have a way to specify a pattern with integer, but all of the standard ones are built in.
414+
// LUCENENET: .NET doesn't have a way to specify a pattern with integer, but all of the standard ones are built in.
415415
return int.Parse(_scratch.Utf8ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture) - 1;
416416
}
417-
catch (Exception pe) when (pe.IsParseException())
417+
catch (Exception pe) when (pe.IsParseException() || pe.IsNumberFormatException())
418418
{
419419
var e = new CorruptIndexException($"failed to parse ord (resource={_input})", pe);
420420
throw e;

0 commit comments

Comments
 (0)