Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
euptron opened this issue Sep 12, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@euptron
Copy link
Owner

euptron commented Sep 12, 2024

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)
@euptron euptron added the bug Something isn't working label Sep 12, 2024
@euptron euptron self-assigned this Sep 12, 2024
@euptron euptron changed the title App crashed due to Null CircularProgressIndicator in CodeEditorPane.setLoading() App crashed due to null CircularProgressIndicator in CodeEditorPane.setLoading() Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant