Skip to content

Commit fbb112e

Browse files
authored
Merge pull request #272 from nextcloud/backport/268/stable28
[stable28] fix(Operation): getLocalFile returns false meanwhile
2 parents 9cf717d + 4d5208c commit fbb112e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/BackgroundJobs/Launcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function run($argument): void {
5959
$command = str_replace('%f', escapeshellarg($tmpFile), $command);
6060
}
6161

62-
// with wrapping sh around the the command, we leave any redirects in tact,
62+
// with wrapping sh around the command, we leave any redirects intact,
6363
// but ensure that the script is not blocking Nextcloud's execution
6464
$wrapper = 'sh -c ' . escapeshellarg($command) . ' >/dev/null &';
6565
$this->logger->info(

lib/Operation.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatch
172172
}
173173
$this->jobList->add(Launcher::class, $args);
174174
}
175-
} catch (NotFoundException $e) {
175+
} catch (NotFoundException) {
176176
}
177177
}
178178

@@ -199,11 +199,11 @@ protected function buildCommand(string $template, Node $node, string $event, arr
199199
if ($node instanceof FileNode) {
200200
$fullPath = $view->getLocalFile($node->getPath());
201201
}
202-
if ($fullPath === null) {
202+
if (!isset($fullPath) || $fullPath === false) {
203203
throw new InvalidArgumentException();
204204
}
205205
$command = str_replace('%f', escapeshellarg($fullPath), $command);
206-
} catch (Exception $e) {
206+
} catch (Exception) {
207207
throw new InvalidArgumentException('Could not determine full path');
208208
}
209209
}
@@ -212,7 +212,7 @@ protected function buildCommand(string $template, Node $node, string $event, arr
212212
$nodeID = -1;
213213
try {
214214
$nodeID = $node->getId();
215-
} catch (InvalidPathException | NotFoundException $e) {
215+
} catch (InvalidPathException | NotFoundException) {
216216
}
217217
$command = str_replace('%i', escapeshellarg((string)$nodeID), $command);
218218
}

0 commit comments

Comments
 (0)