Prevent crash when OCR traineddata file is missing

This commit is contained in:
WarmUpTill
2026-05-13 18:39:03 +02:00
parent 5a5d590c51
commit a7ca06d25c
3 changed files with 6 additions and 3 deletions

View File

@@ -231,10 +231,9 @@ std::optional<std::string> RunOCR(tesseract::TessBaseAPI *ocr,
const QImage &image, const QColor &color,
double colorDiff)
{
(void)ocr;
(void)color;
(void)colorDiff;
if (image.isNull()) {
if (!ocr || image.isNull()) {
return {};
}