Skip to content

Commit 6793828

Browse files
authored
Ignore removed entries in CHANGED_FROM_STATIC (#6240)
The check fails if the `after` state is null. This cases only happens when the entry has been removed entirely, instead of only changed from static to non-static. There are other tests that look for those changes, so it's safe to ignore it from the CHANGED_FROM_STATIC check.
1 parent 2eb7cd7 commit 6793828

File tree

1 file changed

+4
-0
lines changed
  • buildSrc/src/main/java/com/google/firebase/gradle/plugins/semver

1 file changed

+4
-0
lines changed

buildSrc/src/main/java/com/google/firebase/gradle/plugins/semver/DeltaType.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,10 @@ enum class DeltaType {
594594
},
595595
CHANGED_FROM_STATIC {
596596
override fun getViolations(before: ClassInfo?, after: ClassInfo?): List<Delta> {
597+
// Safe to ignore: if `after` is null, then it has been removed and another check will
598+
// report this.
599+
if (after == null) return emptyList()
600+
597601
val allBeforeMethods = getAllMethods(before)
598602
val allAfterMethods = getAllMethods(after)
599603
val afterStaticMethods =

0 commit comments

Comments
 (0)