TreatmentService.createOrUpdate: log invalid argument.

This commit is contained in:
Johannes Mockenhaupt 2020-03-22 11:57:29 +01:00
parent 843fccb86c
commit e7c7ce32bb
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -280,6 +280,10 @@ public class TreatmentService extends OrmLiteBaseService<DatabaseHelper> {
// return true if new record is created
public UpdateReturn createOrUpdate(Treatment treatment) {
if (treatment != null && treatment.source == Source.NONE) {
log.error("Coder error: source is not set for treatment: " + treatment, new Exception());
FabricPrivacy.logException(new Exception("Coder error: source is not set for treatment: " + treatment));
}
try {
Treatment old;
treatment.date = DatabaseHelper.roundDateToSec(treatment.date);