Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions apps/files_sharing/lib/Command/ExiprationNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/
namespace OCA\Files_Sharing\Command;

use OCA\Files_Sharing\OrphanHelper;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IDBConnection;
use OCP\Notification\IManager as NotificationManager;
Expand All @@ -48,7 +49,9 @@
public function __construct(ITimeFactory $time,
NotificationManager $notificationManager,
IDBConnection $connection,
ShareManager $shareManager) {
ShareManager $shareManager,
private OrphanHelper $orphanHelper,
) {
parent::__construct();

$this->notificationManager = $notificationManager;
Expand Down Expand Up @@ -80,7 +83,8 @@
foreach ($shares as $share) {
if ($share->getExpirationDate() === null
|| $share->getExpirationDate()->getTimestamp() < $minTime->getTimestamp()
|| $share->getExpirationDate()->getTimestamp() > $maxTime->getTimestamp()) {
|| $share->getExpirationDate()->getTimestamp() > $maxTime->getTimestamp()

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method getTimestamp on possibly null value
|| !$this->orphanHelper->isShareValid($share->getSharedBy(), $share->getNodeId())) {
continue;
}

Expand Down
Loading