We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ed7adae commit e27fb4aCopy full SHA for e27fb4a
1 file changed
src/Components/CacheHelper.php
@@ -17,7 +17,12 @@ private static function getSizeFast(string $dir): ?int
17
{
18
$output = null;
19
exec('du -s "' . $dir . '"', $output);
20
- if (preg_match('/[0-9]+/', $output[0], $match)) {
+
21
+ if (!isset($output[0])) {
22
+ return null;
23
+ }
24
25
+ if (preg_match('/\d+/', $output[0], $match)) {
26
return $match[0] * 1024;
27
}
28
0 commit comments