Skip to content

BUG : unable to add sports to the user favorite list  #32

Description

@Kenan-Kamel

I'm unable to add a given sport to my favorite list, and each time I try the app keeps crashing with the following logs.

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.sportcaveapp, PID: 11188
java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.contains(java.lang.Object)' on a null object reference
at com.example.sportcaveapp.fragments.SportsFragment.favSport(SportsFragment.java:147)
at com.example.sportcaveapp.fragments.SportsFragment.access$200(SportsFragment.java:32)
at com.example.sportcaveapp.fragments.SportsFragment$3.onClick(SportsFragment.java:100)
at android.view.View.performClick(View.java:7125)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
at android.view.View.performClickInternal(View.java:7102)
at android.view.View.access$3500(View.java:801)
at android.view.View$PerformClick.run(View.java:27336)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

it seems that the issue is a null pointer exception/ null object for the boolean meaning that at one place of the code the value are not set to something T/F but just null

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions