Skip to content

NPE & unable to start if selected board doesn't exist #2635

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

Closed
PaulStoffregen opened this issue Feb 12, 2015 · 2 comments
Closed

NPE & unable to start if selected board doesn't exist #2635

PaulStoffregen opened this issue Feb 12, 2015 · 2 comments
Assignees
Labels

Comments

@PaulStoffregen
Copy link
Contributor

If you add a 3rd party package, select one of its boards, and then quit Arduino and delete the package, the IDE will be unable to start again.

I believe the problem is likely in BaseNoGui.onBoardOrPortChange, at line 692:
https://github.com/arduino/Arduino/blob/master/arduino-core/src/processing/app/BaseNoGui.java#L692

  String core = getBoardPreferences().get("build.core");
  if (core.contains(":")) {

If the currently selected board, according to stored preferences, no longer exists, then the string will be null. Calling contains(":") without first checking for null throws a NPE.

The IDE can't recover or start up. Reinstalling the IDE can't recover either! The user must manually edit or delete their prefs file, or restore the missing package, but there's no way they'd know to do so.

@ffissore ffissore self-assigned this Feb 12, 2015
@ffissore
Copy link
Contributor

Confirm. If user has a boards.txt that misses build.core, an NPE is thrown

@ffissore
Copy link
Contributor

Fixed in nightly builds

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

No branches or pull requests

2 participants