mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-09 19:13:26 +00:00
Fix uncaught Exception in caption_field_value creation
This commit is contained in:
@@ -264,8 +264,13 @@ class caption_Field_Value implements cache_cacheableInterface
|
||||
|
||||
// Check consistency
|
||||
if (! $databox_field->is_multi()) {
|
||||
$field = $record->get_caption()->get_field($databox_field->get_name());
|
||||
$values = $field->get_values();
|
||||
try {
|
||||
$field = $record->get_caption()->get_field($databox_field->get_name());
|
||||
$values = $field->get_values();
|
||||
} catch (Exception $exception) {
|
||||
// Field was not found, so no values found either
|
||||
$values = [];
|
||||
}
|
||||
if (! empty($values)) {
|
||||
$caption_field_value = array_pop($values);
|
||||
/* @var \caption_Field_Value $caption_field_value */
|
||||
|
Reference in New Issue
Block a user