GUACAMOLE-1769: Handle case that KSM's getCustom() returns null.

This commit is contained in:
Michael Jumper
2023-04-13 13:38:53 -07:00
parent 9ae0c98857
commit 486fe6f42a

View File

@@ -212,7 +212,9 @@ public class KsmRecordService {
* The type of field to return. * The type of field to return.
* *
* @param fields * @param fields
* The list of fields to retrieve the field from. * The list of fields to retrieve the field from. For convenience, this
* may be null. A null list will be considered equivalent to an empty
* list.
* *
* @param fieldClass * @param fieldClass
* The class representing the type of field to return. * The class representing the type of field to return.
@@ -229,6 +231,10 @@ public class KsmRecordService {
private <T extends KeeperRecordField> T getField(List<KeeperRecordField> fields, private <T extends KeeperRecordField> T getField(List<KeeperRecordField> fields,
Class<T> fieldClass, Pattern labelPattern) { Class<T> fieldClass, Pattern labelPattern) {
// There are no fields if no List was provided at all
if (fields == null)
return null;
T foundField = null; T foundField = null;
for (KeeperRecordField field : fields) { for (KeeperRecordField field : fields) {