From 45634d9c0c43892028a325af52b1ca2433a94163 Mon Sep 17 00:00:00 2001 From: Jonas Termansen Date: Fri, 6 Mar 2020 17:53:46 +0100 Subject: [PATCH] Check for FileSystemEntityType.notFound (#80) The Dart breaking change will change the timestamps on the notFound object from null to the epoch timestamp. --- lib/src/stat.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/stat.dart b/lib/src/stat.dart index 6430d0b..fb157a5 100644 --- a/lib/src/stat.dart +++ b/lib/src/stat.dart @@ -28,5 +28,6 @@ Future modificationTime(String path) async { } final stat = await FileStat.stat(path); + if (stat.type == FileSystemEntityType.notFound) return null; return stat.modified; }