Fix tests
This commit is contained in:
parent
d50ea18598
commit
532025a348
10 changed files with 463 additions and 573 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
namespace Pterodactyl\Services\Databases;
|
||||
|
||||
use Pterodactyl\Models\Database;
|
||||
use Illuminate\Database\DatabaseManager;
|
||||
use Illuminate\Contracts\Encryption\Encrypter;
|
||||
use Pterodactyl\Extensions\DynamicDatabaseConnection;
|
||||
|
@ -95,7 +96,7 @@ class DatabaseManagementService
|
|||
$this->database->commit();
|
||||
} catch (\Exception $ex) {
|
||||
try {
|
||||
if (isset($database)) {
|
||||
if (isset($database) && $database instanceof Database) {
|
||||
$this->repository->dropDatabase($database->database);
|
||||
$this->repository->dropUser($database->username, $database->remote);
|
||||
$this->repository->flush();
|
||||
|
|
Reference in a new issue