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:
Loz Calver 2014-08-06 16:17:47 +01:00
parent 526de4586c
commit b446056374

View File

@ -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 {
}
}
?>
?>