anilgkts / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

NullPointerException if board.bootloader.path not defined #919

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Create a board definition in boards.txt without a bootloader definition.

What is the expected output? What do you see instead?

The new Leonardo support code throws a NullPointerException.

What version of the Arduino software are you using? On what operating
system?  Which Arduino board are you using?

Arduino 1.0.1 on Linux.

Please provide any additional information below.

This line (AvrdudeUploader.java, line 88), dereferences the result of 
boardPreferences.get("bootloader.path") without first checking if it is null.

    if (boardPreferences.get("bootloader.path").equals("caterina")) {

There are at least 2 places where the string's equals() method is called 
without checking for null.

As a workaround, and board which doesn't use a bootloader will need to define a 
dummy "bootloader.path" to avoid this bug.

Original issue reported on code.google.com by paul.sto...@gmail.com on 22 May 2012 at 8:32

GoogleCodeExporter commented 9 years ago
Good catch.  I'll fix this for the next release.

Original comment by dmel...@gmail.com on 23 May 2012 at 2:53

GoogleCodeExporter commented 9 years ago
https://github.com/arduino/Arduino/commit/ec3c8123bf5f707a9b3d08a4c65eda75a98314
05

Original comment by dmel...@gmail.com on 6 Jun 2012 at 1:30