Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ed095c3 authored by Cole Faust's avatar Cole Faust
Browse files

Add null checks

Lint is being updated, and a type that used to be non-null
is now nullable, and needs to be null checked.

Bug: 247885568
Bug: 249337906
Bug: 249335143
Test: Presubmits
Change-Id: I3efc2d206a17a58dbff4306c98666cb4b06b0de7
parent 85a6ce06
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -82,8 +82,16 @@ class EnforcePermissionDetector : Detector(), SourceCodeScanner {
            if (attr1[i].name != attr2[i].name) {
                return false
            }
            val v1 = ConstantEvaluator.evaluate(context, attr1[i].value)
            val v2 = ConstantEvaluator.evaluate(context, attr2[i].value)
            val value1 = attr1[i].value
            val value2 = attr2[i].value
            if (value1 == null && value2 == null) {
                continue
            }
            if (value1 == null || value2 == null) {
                return false
            }
            val v1 = ConstantEvaluator.evaluate(context, value1)
            val v2 = ConstantEvaluator.evaluate(context, value2)
            if (v1 != v2) {
                return false
            }