Fixed breaking bug for some sources (#561)

This commit is contained in:
Imran Remtulla
2023-05-13 02:32:06 -04:00
parent 0cd4385de7
commit 431a01f2a5
4 changed files with 71 additions and 62 deletions

View File

@@ -145,7 +145,8 @@ class AppsProvider with ChangeNotifier {
}
var client = Client();
StreamedResponse response = await client.send(req);
var ext = response.headers['content-disposition']!.split('.').last;
String ext =
response.headers['content-disposition']?.split('.').last ?? 'apk';
if (ext.endsWith('"') || ext.endsWith("other")) {
ext = ext.substring(0, ext.length - 1);
}