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

Handle throwable with null message in REPL #3081

Open
wants to merge 5 commits into
base: ucr
Choose a base branch
from

Conversation

XomaDev
Copy link
Contributor

@XomaDev XomaDev commented Dec 27, 2023

https://github.com/mit-cml/appinventor-sources/blob/master/appinventor/buildserver/src/com/google/appinventor/buildserver/resources/runtime.scm#L419

Companion crashes where it fails to handle throwable with null error message, while this does not happen if the throwable has an empty or non-null string.

This happened at

  • Fixes crash in a companion when a throwable is thrown with a null error message (runtime.scm)
  • Use newer API for AlertDialog.setButton()
  • Also change classes referencing RuntimeErrorAlert.alert()

image

*Fixes crash in a companion when a throwable is thrown with a null error message (runtime.scm)
*Use newer API for AlertDialog.setButton()
*Also change classes referencing RuntimeErrorAlert.alert()
@AppInventorWorkerBee
Copy link
Collaborator

Can one of the admins verify this patch?

@ewpatton
Copy link
Member

@AppInventorWorkerBee ok to test

@ewpatton ewpatton changed the base branch from master to ucr December 29, 2023 01:13
@ewpatton
Copy link
Member

@XomaDev Note that because this affects companion behavior I have updated the base branch to ucr.

@ewpatton
Copy link
Member

Is there an AIA file that will demonstrate the issue?

@jisqyv
Copy link
Member

jisqyv commented Dec 29, 2023

Using a newer API requires testing on older versions of Android that we still support.

@jisqyv
Copy link
Member

jisqyv commented Dec 29, 2023

I just checked, and the use of a different API for setButton should be fine (as of API level 3).

@XomaDev
Copy link
Contributor Author

XomaDev commented Dec 29, 2023

Is there an AIA file that will demonstrate the issue?

CompanionCrash.aia.zip

@SimpleFunction(description = "Does a crash")
public void Crash() throws Exception {
  throw new Exception();
}

@ewpatton ewpatton self-assigned this Jan 11, 2024
@XomaDev XomaDev requested a review from ewpatton January 13, 2024 13:47
@XomaDev
Copy link
Contributor Author

XomaDev commented Jan 13, 2024

So now

  • When non-REPL: dialog is shown
  • When REPL and toastAllowed: Toast+Report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants