add null handling checkData

Signed-off-by: Laurent ARNAL <laurent@clae.net>
pull/16355/head
Laurent ARNAL 2025-01-26 09:14:37 +01:00
parent 5cccb4f2c7
commit d184f9abfc
1 changed files with 10 additions and 2 deletions

View File

@ -862,8 +862,16 @@ public class LinkyHandler extends BaseThingHandler {
}
private void logData(IntervalReading[] ivArray, int index, String title, DateTimeFormatter dateTimeFormatter) {
IntervalReading iv = ivArray[index];
logger.debug("{} {} value {}", title, iv.date.format(dateTimeFormatter), iv.value);
try {
IntervalReading iv = ivArray[index];
String date = "";
if (iv.date != null) {
date = iv.date.format(dateTimeFormatter);
}
logger.debug("{} {} value {}", title, date, iv.value);
} catch (Exception e) {
logger.error("error during logData", e);
}
}
public void saveConfiguration(Configuration config) {