fix npe when createStorage() returns null

This commit is contained in:
Jörn Friedrich Dreyer 2013-03-19 15:02:29 +01:00
parent aa3973d365
commit 39665cfa6b

View file

@ -90,7 +90,11 @@ class Mount {
public function getStorageId() {
if (!$this->storageId) {
if (is_null($this->storage)) {
$this->storage = $this->createStorage();
$storage = $this->createStorage(); //FIXME: start using exceptions
if (is_null($storage)) {
return null;
}
$this->storage = $storage;
}
$this->storageId = $this->storage->getId();
if (strlen($this->storageId) > 64) {