From 570b64aafcd57958d142ec829eac877c472542c0 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 6 Apr 2023 11:52:22 +0200 Subject: handle not being able to write file for notify self-test Signed-off-by: Robin Appelman --- apps/files_external/lib/Command/Notify.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/files_external/lib/Command/Notify.php b/apps/files_external/lib/Command/Notify.php index 60639f7dbe4..5013d88539b 100644 --- a/apps/files_external/lib/Command/Notify.php +++ b/apps/files_external/lib/Command/Notify.php @@ -326,7 +326,10 @@ class Notify extends Base { private function selfTest(IStorage $storage, INotifyHandler $notifyHandler, OutputInterface $output) { usleep(100 * 1000); //give time for the notify to start - $storage->file_put_contents('/.nc_test_file.txt', 'test content'); + if (!$storage->file_put_contents('/.nc_test_file.txt', 'test content')) { + $output->writeln("Failed to create test file for self-test"); + return; + } $storage->mkdir('/.nc_test_folder'); $storage->file_put_contents('/.nc_test_folder/subfile.txt', 'test content'); -- cgit v1.2.3