Skip to content

Commit ea7d61b

Browse files
authored
PersistenceExtensions: fix DateTimeException when persisting an empty TimeSeries (#4303)
Signed-off-by: Jimmy Tanagra <[email protected]>
1 parent 21e605d commit ea7d61b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/extensions/PersistenceExtensions.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public static void persist(Item item, TimeSeries timeSeries, @Nullable String se
211211

212212
private static void internalPersist(Item item, TimeSeries timeSeries, @Nullable String serviceId) {
213213
String effectiveServiceId = serviceId == null ? getDefaultServiceId() : serviceId;
214-
if (effectiveServiceId == null) {
214+
if (effectiveServiceId == null || timeSeries.size() == 0) {
215215
return;
216216
}
217217
PersistenceService service = getService(effectiveServiceId);

0 commit comments

Comments
 (0)