Skip to content

Commit

Permalink
#4273: Datastore MySQL Import handles empty file incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-korn authored and dmundra committed Sep 17, 2024
1 parent 46ba5e4 commit 62a7602
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ protected function runIt() {
return $this->setResultError(sprintf('Unable to resolve file name "%s" for resource with identifier "%s".', $this->resource->getFilePath(), $this->resource->getId()));
}

$size = @filesize($file_path);
if (!$size) {
return $this->setResultError("Can't get size from file {$file_path}");
}

// Read the columns and EOL character sequence from the CSV file.
$delimiter = $this->resource->getMimeType() == 'text/tab-separated-values' ? "\t" : ',';
try {
Expand Down

0 comments on commit 62a7602

Please sign in to comment.