This repository was archived by the owner on Sep 10, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -138,10 +138,19 @@ function indexAction()
138
138
{
139
139
$ assetstores [$ key ]->default = false ;
140
140
}
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
+ }
145
154
}
146
155
147
156
if (!$ defaultSet )
You can’t perform that action at this time.
0 commit comments