Skip to content

Commit 6bed07b

Browse files
committed
chore: verify user null
Signed-off-by: Crisciany Souza <criscianysilva1997@gmail.com>
1 parent 32b5b4c commit 6bed07b

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

lib/Service/AccountService.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ public function getConfig(?IUser $user = null): array {
233233
$info['hasSignatureFile'] = $this->hasSignatureFile($user);
234234
$info['phoneNumber'] = $this->getPhoneNumber($user);
235235
$info['isApprover'] = $this->validateHelper->userCanApproveValidationDocuments($user, false);
236-
//$info['grid_view'] = $this->appConfig->getValueBool(Application::APP_ID, 'grid_view', false);
237-
$info['grid_view'] = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'grid_view', false) === '1';
236+
$info['grid_view'] = $this->getUserConfigGridView($user);
238237

239238
return $info;
240239
}
@@ -261,6 +260,14 @@ public function hasSignatureFile(?IUser $user = null): bool {
261260
}
262261
}
263262

263+
private function getUserConfigGridView(?IUser $user = null): bool {
264+
if (!$user) {
265+
return false;
266+
}
267+
268+
return $this->config->getUserValue($user->getUID(), Application::APP_ID, 'grid_view', false) === '1';
269+
}
270+
264271
/**
265272
* Get PDF node by UUID
266273
*

0 commit comments

Comments
 (0)