Skip to content

Commit fd9dc8b

Browse files
committed
fix: prevent error when class doesn't exists
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 70680c5 commit fd9dc8b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/Service/IdentifyMethodService.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ private function getNewInstanceOfMethod(string $name): IIdentifyMethod {
9999
$className = 'OCA\Libresign\Service\IdentifyMethod\\' . ucfirst($name);
100100
if (!class_exists($className)) {
101101
$className = 'OCA\Libresign\Service\IdentifyMethod\\SignatureMethod\\' . ucfirst($name);
102+
if (!class_exists($className)) {
103+
// TRANSLATORS When is requested to a person to sign a file, is
104+
// necessary identify what is the identification method. The
105+
// identification method is used to define how will be the sign
106+
// flow.
107+
throw new LibresignException($this->l10n->t('Invalid identification method'));
108+
}
102109
}
103110
/** @var IIdentifyMethod */
104111
$identifyMethod = clone \OCP\Server::get($className);

0 commit comments

Comments
 (0)