{"record":{"id":"c2eccf8af1b0ed7a","repo":"microg/GmsCore","slug":"transitionevents-list-can-t-be-null","errorCode":null,"errorMessage":"transitionEvents list can't be null.","messagePattern":"transitionEvents list can't be null\\.","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"play-services-location/src/main/java/com/google/android/gms/location/ActivityTransitionResult.java","lineNumber":42,"sourceCode":"@PublicApi\npublic class ActivityTransitionResult extends AutoSafeParcelable {\n    private static final String EXTRA = \"com.google.android.location.internal.EXTRA_ACTIVITY_TRANSITION_RESULT\";\n\n    @Field(value = 1, subClass = ActivityTransitionEvent.class)\n    @NonNull\n    private List<ActivityTransitionEvent> transitionEvents;\n    @Field(2)\n    private Bundle extras;\n\n    /**\n     * Constructs a result by specifying a list of transition events.\n     *\n     * @param transitionEvents the transition events\n     * @throws NullPointerException     if {@code transitionEvents} is {@code null}\n     * @throws IllegalArgumentException if the events in {@code transitionEvents} are not in ascending order of time\n     */\n    public ActivityTransitionResult(List<ActivityTransitionEvent> transitionEvents) {\n        if (transitionEvents == null) throw new NullPointerException(\"transitionEvents list can't be null.\");\n        for (int i = 1; i < transitionEvents.size(); i++) {\n            if (transitionEvents.get(i).getElapsedRealTimeNanos() < transitionEvents.get(i - 1).getElapsedRealTimeNanos())\n                throw new IllegalArgumentException();\n        }\n        this.transitionEvents = Collections.unmodifiableList(transitionEvents);\n    }\n\n    /**\n     * Gets all the activity transition events in this result. The events are in ascending order of time, and may include events in the past.\n     */\n    public List<ActivityTransitionEvent> getTransitionEvents() {\n        return transitionEvents;\n    }\n\n    /**\n     * Extracts the {@link ActivityTransitionResult} from the given {@link Intent}.\n     *\n     * @param intent the {@link Intent} to extract the result from","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-location/src/main/java/com/google/android/gms/location/ActivityTransitionResult.java#L24-L60","documentation":"The ActivityTransitionResult(List<ActivityTransitionEvent>) constructor validates its input: a null transitionEvents list fails the Preconditions check and raises NullPointerException with this message.","triggerScenarios":"Thrown at play-services-location/src/main/java/com/google/android/gms/location/ActivityTransitionResult.java:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null (possibly empty) list of ActivityTransitionEvent","Default to Collections.emptyList() when reconstructing from missing data"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}