mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-25 11:45:49 +01:00
[jsondb] Restore zero byte files from backup (#2155)
* Restore zero byte files from backup * Also handle zero byte backup files Signed-off-by: Mike Major <mike_j_major@hotmail.com>
This commit is contained in:
parent
12659595a6
commit
86a447c23a
@ -216,6 +216,11 @@ public class JsonStorage<T> implements Storage<T> {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private @Nullable Map<String, StorageEntry> readDatabase(File inputFile) {
|
||||
if (inputFile.length() == 0) {
|
||||
logger.warn("Json storage file at '{}' is empty - ignoring corrupt file.", inputFile.getAbsolutePath());
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
final Map<String, StorageEntry> inputMap = new ConcurrentHashMap<>();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user