]> git.mxchange.org Git - friendica.git/blobdiff - src/Console/Storage.php
Merge pull request #10575 from MrPetovan/bug/10019-peertube-embed
[friendica.git] / src / Console / Storage.php
index d0a2a66637a19c831997cbded40832ec42c29dfd..93bbb26579a28db8b72110d29b69ccc7b844b659 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -23,6 +23,7 @@ namespace Friendica\Console;
 
 use Asika\SimpleConsole\CommandArgsException;
 use Friendica\Core\StorageManager;
+use Friendica\Model\Storage\StorageException;
 
 /**
  * tool to manage storage backend and stored data from CLI
@@ -165,6 +166,10 @@ HELP;
                $current = $this->storageManager->getBackend();
                $total = 0;
 
+               if (is_null($current)) {
+                       throw new StorageException(sprintf("Cannot move to legacy storage. Please select a storage backend."));
+               }
+
                do {
                        $moved = $this->storageManager->move($current, $tables, $this->getOption('n', 5000));
                        if ($moved) {