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

@@ -108,7 +108,10 @@ public:
void SetCustomConfigFile(const std::string &);
std::string GetCustomConfigFile() const { return configFile; }
tesseract::PageSegMode GetPageMode() const { return pageSegMode; }
tesseract::TessBaseAPI *GetOCR() const { return ocr.get(); }
tesseract::TessBaseAPI *GetOCR() const
{
return initDone ? ocr.get() : nullptr;
}
StringVariable text = obs_module_text("AdvSceneSwitcher.enterText");
RegexConfig regex = RegexConfig::PartialMatchRegexConfig();