mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 09:06:00 +00:00
FIX: Prevent errors when an extractor isn’t available
Before this change, it would loop over all extractors that matched the file extension and attempt extraction, even if they weren’t configured.
This commit is contained in:
parent
526de4586c
commit
b446056374
@ -28,7 +28,7 @@ class FileTextExtractable extends DataExtension {
|
||||
|
||||
// Determine which extractor can process this file.
|
||||
$extractor = FileTextExtractor::for_file($this->owner->FullPath);
|
||||
if (!$extractor) return null;
|
||||
if (!$extractor || !$extractor->isAvailable()) return null;
|
||||
|
||||
$text = $extractor->getContent($this->owner->FullPath);
|
||||
if (!$text) return null;
|
||||
@ -40,4 +40,4 @@ class FileTextExtractable extends DataExtension {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user