diff --git a/modules/datastore/modules/datastore_mysql_import/src/Service/MysqlImport.php b/modules/datastore/modules/datastore_mysql_import/src/Service/MysqlImport.php index 03470a9a85..bb283b217d 100644 --- a/modules/datastore/modules/datastore_mysql_import/src/Service/MysqlImport.php +++ b/modules/datastore/modules/datastore_mysql_import/src/Service/MysqlImport.php @@ -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 {