Skip to content

App crashed due to null CircularProgressIndicator in CodeEditorPane.setLoading() #9

@euptron

Description

@euptron

Problem Description

The app encounters a NullPointerException when attempting to access the CircularProgressIndicator (referenced as progressbar) in the CodeEditorPane.setLoading() method. This error occurs because the progressbar is not properly initialized in the LayoutCodeEditorBinding. When the app tries to update the progress indicator while reading a file, it crashes due to the null reference.

Steps to Reproduce the Behavior

  1. Open the app and navigate to the CodeEditorPane.
  2. Trigger an action that involves loading a file (e.g., reading a file with charset).
  3. The app crashes when trying to update the progress indicator.

Expected Behavior

  • The app should check the undo state in the CodeEditorPane without crashing. It should ensure that the ContextualCodeEditor object is not null before calling the canUndo() method.

Crash Details

  • Crash Date: Sat Aug 17 2024 10:19:46 GMT+0100 (West Africa Standard Time)
Crashlytics Issue ID

fcc3d4f7d3825fd148be619cf777948b

  • Thread: main
  • Exception: java.lang.NullPointerException
    Message:
    java.lang.NullPointerException: Attempt to read from field 'com.google.android.material.progressindicator.CircularProgressIndicator com.eup.codeopsstudio.databinding.LayoutCodeEditorBinding.progressbar' on a null object reference
    

The app crashes with a NullPointerException when attempting to access a CircularProgressIndicator from the LayoutCodeEditorBinding in the CodeEditorPane.setLoading() method. The progressbar is null, causing the crash.

Stack Trace

Non-fatal Exception: java.lang.NullPointerException: Attempt to read from field 'com.google.android.material.progressindicator.CircularProgressIndicator com.eup.codeopsstudio.databinding.LayoutCodeEditorBinding.progressbar' on a null object reference
       at com.eup.codeopsstudio.ui.editor.code.CodeEditorPane.setLoading(CodeEditorPane.java:247)
       at com.eup.codeopsstudio.ui.editor.code.CodeEditorPane.lambda$readFileWithCharset$6(CodeEditorPane.java:224)
       at com.eup.codeopsstudio.ui.editor.code.CodeEditorPane.$r8$lambda$6YAHIWwMdFm0JBDPstRqIr8bcyU()
       at com.eup.codeopsstudio.ui.editor.code.CodeEditorPane$$ExternalSyntheticLambda13.onComplete(:6)
       at com.eup.codeopsstudio.common.AsyncTask.lambda$runNonCancelable$5(AsyncTask.java:163)
       at com.eup.codeopsstudio.common.AsyncTask$$ExternalSyntheticLambda10.run(:6)
       at android.os.Handler.handleCallback(Handler.java:873)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:233)
       at android.app.ActivityThread.main(ActivityThread.java:7212)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:499)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

System Information

  • Package Name: com.eup.codeopsstudio
  • App Version: 1.0.0 (1)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions