Skip to content

Commit 8f5a152

Browse files
committed
files_external SMB: throw InvalidArgument when user is not set
Signed-off-by: Anderson Luiz Alves <alacn1@gmail.com>
1 parent aee3bb4 commit 8f5a152

File tree

1 file changed

+3
-0
lines changed
  • apps/files_external/lib/Lib/Backend

1 file changed

+3
-0
lines changed

apps/files_external/lib/Lib/Backend/SMB.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public function __construct(IL10N $l, Password $legacyAuth) {
7676
public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
7777
$auth = $storage->getAuthMechanism();
7878
if ($auth->getScheme() === AuthMechanism::SCHEME_PASSWORD) {
79+
if(!is_string($storage->getBackendOption('user')) || !is_string($storage->getBackendOption('password')))
80+
throw new \InvalidArgumentException('user or password is not set');
81+
7982
$smbAuth = new BasicAuth(
8083
$storage->getBackendOption('user'),
8184
$storage->getBackendOption('domain'),

0 commit comments

Comments
 (0)