Skip to content

Commit

Permalink
bytecodeVersion could be null
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Aug 25, 2023
1 parent 5494c8f commit 683da2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions formats/src/main/kotlin/com/jakewharton/diffuse/format/Jar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.jakewharton.diffuse.io.Input

class Jar private constructor(
override val filename: String?,
val bytecodeVersion: Short,
val bytecodeVersion: Short?,
val files: ArchiveFiles,
val classes: List<Class>,
override val declaredMembers: List<Member>,
Expand All @@ -26,7 +26,7 @@ class Jar private constructor(
.filter { it.path.endsWith(".class") }
.map { it.asInput().toClass() }

val bytecodeVersion = classes.first().bytecodeVersion
val bytecodeVersion = classes.firstOrNull()?.bytecodeVersion

val declaredMembers = classes.flatMap { it.declaredMembers }
val referencedMembers = classes.flatMapTo(LinkedHashSet()) { it.referencedMembers }
Expand Down

0 comments on commit 683da2d

Please sign in to comment.