Merge branch 'develop' of github.com:MISP/MISP into develop

pull/8063/merge
Sami Mokaddem 2022-03-17 14:43:27 +01:00
commit 4af6a4d1aa
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 6 additions and 2 deletions

View File

@ -37,7 +37,11 @@ class CryptographicKey extends AppModel
public function __construct($id = false, $table = null, $ds = null)
{
parent::__construct($id, $table, $ds);
$this->gpg = GpgTool::initializeGpg();
try {
$this->gpg = GpgTool::initializeGpg();
} catch (Exception $e) {
$this->gpg = null;
}
$this->validate = [
'type' => [
'rule' => ['inList', $this->validTypes],

View File

@ -3,7 +3,7 @@ $distribution = Hash::extract($data, $field['path'])[0];
$event_id_path = Hash::extract($data, $field['event_id_path'])[0];
if ($distribution == 4) {
try{
$sg = Hash::extract($data, $field['path']);
$sg = Hash::extract($data, $field['sg_path']);
} catch (Exception $e) {
$sg = null;
}