Skip to content

Commit 05aac0f

Browse files
SupSaiYaJinjason-simmons
authored andcommitted
fix ResourceExtractor npe. (#6461)
1 parent cf5a2a1 commit 05aac0f

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

shell/platform/android/io/flutter/view/ResourceExtractor.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ private String checkTimestamp(File dataDir) {
101101
TIMESTAMP_PREFIX + packageInfo.versionCode + "-" + packageInfo.lastUpdateTime;
102102

103103
final String[] existingTimestamps = getExistingTimestamps(dataDir);
104+
105+
if (existingTimestamps == null) {
106+
return null;
107+
}
108+
104109
if (existingTimestamps.length != 1
105110
|| !expectedTimestamp.equals(existingTimestamps[0])) {
106111
return expectedTimestamp;
@@ -173,7 +178,11 @@ private void deleteFiles() {
173178
file.delete();
174179
}
175180
}
176-
for (String timestamp : getExistingTimestamps(dataDir)) {
181+
final String[] existingTimestamps = getExistingTimestamps(dataDir);
182+
if (existingTimestamps == null) {
183+
return;
184+
}
185+
for (String timestamp : existingTimestamps) {
177186
new File(dataDir, timestamp).delete();
178187
}
179188
}

0 commit comments

Comments
 (0)