From f883fc3bda170637b47ab96d7649ba5947a3732a Mon Sep 17 00:00:00 2001
From: Moritz Strohm <strohm@data-quest.de>
Date: Mon, 31 Jul 2023 16:54:23 +0000
Subject: [PATCH] FileManager::moveFolder: also check the destination folder
 before making a special treatment for StandardFolder, re #2985

Merge request studip/studip!2001
---
 lib/filesystem/FileManager.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/filesystem/FileManager.php b/lib/filesystem/FileManager.php
index 21eb27aec20..55cd769bc7f 100644
--- a/lib/filesystem/FileManager.php
+++ b/lib/filesystem/FileManager.php
@@ -1060,7 +1060,7 @@ class FileManager
         }
 
         $new_folder = null;
-        if ($source_folder instanceof StandardFolder) {
+        if (($source_folder instanceof StandardFolder) && ($destination_folder instanceof StandardFolder)) {
             //Standard folders just have to be put below the
             //destination folder.
             $new_folder = $destination_folder->createSubfolder($source_folder);
-- 
GitLab