GUACAMOLE-1769: Merge fixed null handling for KSM field lookup.

This commit is contained in:
James Muehlner
2023-04-13 13:47:20 -07:00
committed by GitHub

View File

@@ -212,7 +212,9 @@ public class KsmRecordService {
* The type of field to return.
*
* @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
* 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,
Class<T> fieldClass, Pattern labelPattern) {
// There are no fields if no List was provided at all
if (fields == null)
return null;
T foundField = null;
for (KeeperRecordField field : fields) {