diff --git a/src/api/baseapi.cpp b/src/api/baseapi.cpp index dccd7f2a..8127b5cd 100644 --- a/src/api/baseapi.cpp +++ b/src/api/baseapi.cpp @@ -955,6 +955,8 @@ const char *TessBaseAPI::GetDatapath() { } int TessBaseAPI::GetSourceYResolution() { + if (thresholder_ == nullptr) + return -1; return thresholder_->GetSourceYResolution(); }