Browse Source

date parsing: treat empty string as null, but output warning.

pull/3/head
Herbert Poul 4 years ago
parent
commit
e22eaa1481
  1. 4
      lib/src/kdbx_xml.dart

4
lib/src/kdbx_xml.dart

@ -254,6 +254,10 @@ class DateTimeUtcNode extends KdbxSubTextNode<DateTime> {
if (value == null) { if (value == null) {
return null; return null;
} }
if (value.isEmpty) {
_logger.warning('time contains empty string. $name');
return null;
}
try { try {
if (value.contains(':')) { if (value.contains(':')) {
return DateTime.parse(value); return DateTime.parse(value);

Loading…
Cancel
Save