Fix freeze when choosing invalid OCR model

This commit is contained in:
WarmUpTill
2026-05-28 16:33:09 +02:00
committed by WarmUpTill
parent 31c4c1f5d7
commit d590bc11f8
3 changed files with 17 additions and 16 deletions

View File

@@ -403,11 +403,12 @@ bool MacroConditionVideo::CheckBrightnessThreshold()
bool MacroConditionVideo::CheckOCR()
{
if (!_ocrParameters.Initialized()) {
auto *ocr = _ocrParameters.GetOCR();
if (!ocr) {
return false;
}
auto text = RunOCR(_ocrParameters.GetOCR(), _screenshotData.GetImage(),
auto text = RunOCR(ocr, _screenshotData.GetImage(),
_ocrParameters.color, _ocrParameters.colorThreshold);
if (!text) {
return false;