From 13ec5a614b959ea21b917446a49f500b3f2cec36 Mon Sep 17 00:00:00 2001 From: joshuajeschek Date: Thu, 13 Jan 2022 17:36:48 +0100 Subject: [PATCH] [hotfix] TrialData.equals answer can be null --- .../java/github/weichware10/util/data/TrialData.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/github/weichware10/util/data/TrialData.java b/src/main/java/github/weichware10/util/data/TrialData.java index c4ebb4e..e20e958 100644 --- a/src/main/java/github/weichware10/util/data/TrialData.java +++ b/src/main/java/github/weichware10/util/data/TrialData.java @@ -238,8 +238,11 @@ public boolean equals(Object other) { return false; } TrialData that = (TrialData) (other); - return toolType.equals(that.toolType) && trialId.equals(that.trialId) - && configId.equals(that.configId) && startTime.equals(that.startTime) - && answer.equals(that.answer) && dataPoints.equals(that.dataPoints); + return toolType.equals(that.toolType) + && (trialId == that.trialId || trialId.equals(that.trialId)) + && (configId == that.configId || configId.equals(that.configId)) + && startTime.equals(that.startTime) + && (answer == that.answer || answer.equals(that.answer)) + && dataPoints.equals(that.dataPoints); } }