error out if a local storage isn't setup correctly

This commit is contained in:
Robin Appelman 2016-04-25 14:36:53 +02:00 committed by Vincent Petry
parent 9a1688db7c
commit 06bfd58b2c
No known key found for this signature in database
GPG Key ID: AF8F9EFC56562186
1 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,9 @@ class Local extends \OC\Files\Storage\Common {
protected $datadir;
public function __construct($arguments) {
if (!isset($arguments['datadir']) || !is_string($arguments['datadir'])) {
throw new \InvalidArgumentException('No data directory set for local storage');
}
$this->datadir = $arguments['datadir'];
if (substr($this->datadir, -1) !== '/') {
$this->datadir .= '/';