mirror of
https://github.com/moodle/moodle.git
synced 2025-05-01 22:18:03 +02:00
MDL-80202 repository_local: null check when recursing child nodes.
This commit is contained in:
parent
810554ee83
commit
cfd51dd63c
@ -132,11 +132,14 @@ class repository_local extends repository {
|
||||
* This function may skip subfolders and recursively add their children
|
||||
* {@link repository_local::can_skip()}
|
||||
*
|
||||
* @param file_info $fileinfo
|
||||
* @param string|array $extensions, for example '*' or array('.gif','.jpg')
|
||||
* @param file_info|null $fileinfo
|
||||
* @param string|string[] $extensions for example '*' or ['.gif', '.jpg']
|
||||
* @return array array of file_info elements
|
||||
*/
|
||||
private function get_non_empty_children(file_info $fileinfo, $extensions) {
|
||||
private function get_non_empty_children(?file_info $fileinfo, $extensions): array {
|
||||
if ($fileinfo === null) {
|
||||
return [];
|
||||
}
|
||||
$nonemptychildren = $fileinfo->get_non_empty_children($extensions);
|
||||
$list = array();
|
||||
foreach ($nonemptychildren as $child) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user