Skip to content

Fixed NPE in buildProgrammersMenu #10545

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

Merged
merged 1 commit into from
Jul 23, 2020

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Jul 23, 2020

Some platforms may not define directly build.core because it may be defined through a custom menu.

For example, the arduboy platform has in the boards.txt:

[...]
menu.core=Core
[...]
# core #
arduboy-homemade.menu.core.arduboy-core=Arduboy optimized core
arduboy-homemade.menu.core.arduboy-core.build.core=arduboy
arduboy-homemade.menu.core.arduino-core=Standard Arduino core
arduboy-homemade.menu.core.arduino-core.build.core=arduino:arduino
[...]

the build.core is determined only after applying the submenu options.

Before this patch the IDE would not start due to a NullPointerException, this PR fix the exception by checking if the build.core property is directly defined. If it is not the current platform is used instead of an eventual referenced platform.

The proper fix requires to apply all the custom properties and to find the referenced platform, but this is much more involved and requires a much complex PR, the purpose of this PR is to fix the crash and to allow the IDE to start.

Some platforms may not define directly 'build.core' because it may be defined
through a custom menu.

For example, the arduboy platform has in the boards.txt:

   [...]
   menu.core=Core
   [...]
   # core #
   arduboy-homemade.menu.core.arduboy-core=Arduboy optimized core
   arduboy-homemade.menu.core.arduboy-core.build.core=arduboy
   arduboy-homemade.menu.core.arduino-core=Standard Arduino core
   arduboy-homemade.menu.core.arduino-core.build.core=arduino:arduino
   [...]

the build.core is determined only after applying the submenu options.
@cmaglie cmaglie added this to the Release 1.8.14 milestone Jul 23, 2020
@cmaglie cmaglie self-assigned this Jul 23, 2020
@ubidefeo
Copy link

Tested, performing very well, exceptions gone.
Once checks are done it LGTM

@cmaglie cmaglie merged commit 4c45ea8 into arduino:master Jul 23, 2020
@cmaglie cmaglie deleted the fix_programmer_referencing branch July 23, 2020 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants