mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 06:08:46 -04:00
Fixed warning when file_target is not set
In some cases (like in the unit tests) "file_target" is not set yet whenever the target file system hasn't been mounted yet.
This commit is contained in:
parent
5e4e773446
commit
7fac2b62e9
1 changed files with 3 additions and 1 deletions
|
|
@ -58,7 +58,9 @@ class Api {
|
|||
return new \OC_OCS_Result(null, 404, 'could not get shares');
|
||||
} else {
|
||||
foreach ($shares as &$share) {
|
||||
if ($share['item_type'] === 'file') {
|
||||
// file_target might not be set if the target user hasn't mounted
|
||||
// the filesystem yet
|
||||
if ($share['item_type'] === 'file' && isset($share['file_target'])) {
|
||||
$share['mimetype'] = \OC_Helper::getFileNameMimeType($share['file_target']);
|
||||
}
|
||||
$newShares[] = $share;
|
||||
|
|
|
|||
Loading…
Reference in a new issue