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

Commit ea46dea9 authored by Kenny Root's avatar Kenny Root
Browse files

Prevent possible NPE in android.gesture.Learner

Change-Id: If9b0ac9a05b6736719d84c6b58be73e3f7771f07
parent a4437fc9
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -72,7 +72,8 @@ abstract class Learner {
        for (int i = 0; i < count; i++) {
        for (int i = 0; i < count; i++) {
            final Instance instance = instances.get(i);
            final Instance instance = instances.get(i);
            // the label can be null, as specified in Instance
            // the label can be null, as specified in Instance
            if ((instance.label == null && name == null) || instance.label.equals(name)) {
            if ((instance.label == null && name == null)
                    || (instance.label != null && instance.label.equals(name))) {
                toDelete.add(instance);
                toDelete.add(instance);
            }
            }
        }
        }