From 98c8c9b6bb4504433bbc59a7eb52289958eaefa8 Mon Sep 17 00:00:00 2001 From: Abestanis Date: Sun, 13 Oct 2024 10:38:34 +0200 Subject: [PATCH] Don't error when a playlist has no modification date (#145) --- lib/logic/models/playlist.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/logic/models/playlist.dart b/lib/logic/models/playlist.dart index 707907205..fd350dabb 100644 --- a/lib/logic/models/playlist.dart +++ b/lib/logic/models/playlist.dart @@ -108,11 +108,12 @@ class Playlist extends PersistentQueue with DuplicatingSongOriginMixin implement } factory Playlist.fromMap(Map map) { + int dateAdded = map['dateAdded'] as int; return Playlist( id: map['id'] as int, filesystemPath: map['filesystemPath'] as String, - dateAdded: map['dateAdded'] as int, - dateModified: map['dateModified'] as int, + dateAdded: dateAdded, + dateModified: map['dateModified'] as int? ?? dateAdded, name: map['name'] as String, songIds: (map['songIds'] as List).cast().toList(), );