mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-04-11 10:57:59 -04:00
Rewrite loop that stopped working in Kotlin 2.1.21
This commit is contained in:
@@ -67,8 +67,17 @@ class PkpassParser(context: Context, uri: Uri?) {
|
||||
try {
|
||||
mContext.contentResolver.openInputStream(uri).use { inputStream ->
|
||||
ZipInputStream(inputStream).use { zipInputStream ->
|
||||
var localFileHeader: LocalFileHeader
|
||||
while ((zipInputStream.nextEntry.also { localFileHeader = it }) != null) {
|
||||
var localFileHeader: LocalFileHeader?
|
||||
|
||||
while (true) {
|
||||
// Retrieve the next file
|
||||
localFileHeader = zipInputStream.nextEntry
|
||||
|
||||
// If no next file, exit loop
|
||||
if (localFileHeader == null) {
|
||||
break
|
||||
}
|
||||
|
||||
// Ignore directories
|
||||
if (localFileHeader.isDirectory) continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user