summaryrefslogtreecommitdiffstats
path: root/document/src/main
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-09-18 10:32:36 +0200
committerGitHub <noreply@github.com>2018-09-18 10:32:36 +0200
commit056c5b8ba2bed5287b18ed58dd8e2bc72c4505e5 (patch)
tree0605841ad5968195d3ee4af52854b4ecbea2121e /document/src/main
parenteb05c7a5b60ccf448b59038d7416c67f6aa68958 (diff)
Revert "Avoid NPE on non-exiting field"
Diffstat (limited to 'document/src/main')
-rw-r--r--document/src/main/java/com/yahoo/document/DocumentUpdate.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/document/src/main/java/com/yahoo/document/DocumentUpdate.java b/document/src/main/java/com/yahoo/document/DocumentUpdate.java
index 028215c0d6c..301d6af0f54 100644
--- a/document/src/main/java/com/yahoo/document/DocumentUpdate.java
+++ b/document/src/main/java/com/yahoo/document/DocumentUpdate.java
@@ -278,8 +278,7 @@ public class DocumentUpdate extends DocumentOperation implements Iterable<FieldP
* @return the update for the field, or null if that field has no update in this
*/
public FieldUpdate getFieldUpdate(String fieldName) {
- Field field = documentType.getField(fieldName);
- return field != null ? getFieldUpdate(field) : null;
+ return getFieldUpdate(documentType.getField(fieldName));
}
private FieldUpdate getFieldUpdateById(Integer fieldId) {
return id2FieldUpdateMap.get(fieldId);
@@ -397,8 +396,7 @@ public class DocumentUpdate extends DocumentOperation implements Iterable<FieldP
}
public FieldUpdate removeFieldUpdate(String fieldName) {
- Field field = documentType.getField(fieldName);
- return field != null ? removeFieldUpdate(field) : null;
+ return removeFieldUpdate(documentType.getField(fieldName));
}
/**