From a9cee070cdd8e734b5137e45cb30d54e2e6f2678 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Mon, 1 Jun 2020 16:29:50 +0200 Subject: [PATCH] Fix crash in OCR --- libse/Settings.cs | 1 + src/Forms/Ocr/VobSubOcr.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libse/Settings.cs b/libse/Settings.cs index f1a051f29..03c57d71e 100644 --- a/libse/Settings.cs +++ b/libse/Settings.cs @@ -1431,6 +1431,7 @@ $HorzAlign = Center ItalicFactor = 0.2f; LineOcrLinesToAutoGuess = 100; LineOcrMaxErrorPixels = 45; + LastBinaryImageCompareDb = "Latin+Latin"; BinaryAutoDetectBestDb = true; CaptureTopAlign = false; UnfocusedAttentionBlinkCount = 50; diff --git a/src/Forms/Ocr/VobSubOcr.cs b/src/Forms/Ocr/VobSubOcr.cs index 9af382931..149f4055d 100644 --- a/src/Forms/Ocr/VobSubOcr.cs +++ b/src/Forms/Ocr/VobSubOcr.cs @@ -8757,7 +8757,8 @@ namespace Nikse.SubtitleEdit.Forms.Ocr return; } - if (Configuration.Settings.VobSubOcr.LastBinaryImageCompareDb.Contains("+")) + if (Configuration.Settings.VobSubOcr.LastBinaryImageCompareDb != null && + Configuration.Settings.VobSubOcr.LastBinaryImageCompareDb.Contains("+")) { s += "+" + Configuration.Settings.VobSubOcr.LastBinaryImageCompareDb.Split('+')[1]; }