Skip to content

Commit 9da5eae

Browse files
committed
fix: Virus infected File is not removed by background job when integration app is enabled
Signed-off-by: Swikriti Tripathi <swikriti808@gmail.com>
1 parent e2a7baf commit 9da5eae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Listener/BeforeNodeInsideOpenProjectGroupfilderChangedListener.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ public function handle(Event $event): void {
5151
} else {
5252
return;
5353
}
54+
$currentUser = $this->userSession->getUser();
5455
// we do not listen event where user is not logged or there is no user session (e.g. public link )
55-
if (OC_User::isIncognitoMode()) {
56+
// or if it's some background job in which case user will be null
57+
if (OC_User::isIncognitoMode()|| $currentUser === null ) {
5658
return;
5759
}
58-
$currentUserId = $this->userSession->getUser()->getUID();
60+
$currentUserId = $currentUser->getUID();
5961
if (
6062
$this->openprojectAPIService->isProjectFoldersSetupComplete() &&
6163
preg_match('/.*\/files\/' . Application::OPEN_PROJECT_ENTITIES_NAME . '$/', $parentNode->getPath()) === 1 &&

0 commit comments

Comments
 (0)