Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 060c144

Browse files
author
Julien Jomier
committed
BUG: Fixing issue with space computation when assetstore is not accessible
1 parent 5d58d48 commit 060c144

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

core/controllers/AdminController.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,19 @@ function indexAction()
138138
{
139139
$assetstores[$key]->default = false;
140140
}
141-
$assetstores[$key]->totalSpace = disk_total_space($assetstore->getPath());
142-
$assetstores[$key]->totalSpaceText = $this->Component->Utility->formatSize($assetstores[$key]->totalSpace);
143-
$assetstores[$key]->freeSpace = disk_free_space($assetstore->getPath());
144-
$assetstores[$key]->freeSpaceText = $this->Component->Utility->formatSize($assetstores[$key]->freeSpace);
141+
142+
// Check if we can access the path
143+
if(file_exists($assetstore->getPath()))
144+
{
145+
$assetstores[$key]->totalSpace = disk_total_space($assetstore->getPath());
146+
$assetstores[$key]->totalSpaceText = $this->Component->Utility->formatSize($assetstores[$key]->totalSpace);
147+
$assetstores[$key]->freeSpace = disk_free_space($assetstore->getPath());
148+
$assetstores[$key]->freeSpaceText = $this->Component->Utility->formatSize($assetstores[$key]->freeSpace);
149+
}
150+
else
151+
{
152+
$assetstores[$key]->totalSpaceText = false;
153+
}
145154
}
146155

147156
if(!$defaultSet)

0 commit comments

Comments
 (0)