Skip to content

Commit 430d1f2

Browse files
committed
Fix "Bad State: No element" Error on Some Direct APK Links (#2128)
1 parent eb21ba3 commit 430d1f2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/app_sources/html.dart

+6-4
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,12 @@ class HTML extends AppSource {
358358
.toString();
359359
return APKDetails(
360360
version,
361-
[rel]
362-
.map((e) =>
363-
MapEntry('${e.hashCode}-${Uri.parse(e).pathSegments.last}', e))
364-
.toList(),
361+
[rel].map((e) {
362+
var uri = Uri.parse(e);
363+
var fileName =
364+
uri.pathSegments.isNotEmpty ? uri.pathSegments.last : uri.origin;
365+
return MapEntry('${e.hashCode}-$fileName', e);
366+
}).toList(),
365367
AppNames(uri.host, tr('app')));
366368
}
367369
}

0 commit comments

Comments
 (0)