mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-21 15:54:39 +01:00
Fixed null pointer exception in case of missing boot loader.path param in boards.txt
Pre-1.0.1 it was not necessary to have a bootloader.path param in boards.txt under the respective board type. This patch helps keeping compatibility with older settings and avoid dummy param settings.
This commit is contained in:
parent
a9fedabe3c
commit
ec3c8123bf
@ -85,7 +85,7 @@ public class AvrdudeUploader extends Uploader {
|
|||||||
// this wait a moment for the bootloader to enumerate. On Windows, also must
|
// this wait a moment for the bootloader to enumerate. On Windows, also must
|
||||||
// deal with the fact that the COM port number changes from bootloader to
|
// deal with the fact that the COM port number changes from bootloader to
|
||||||
// sketch.
|
// sketch.
|
||||||
if (boardPreferences.get("bootloader.path").equals("caterina")) {
|
if (boardPreferences.get("bootloader.path") != null && boardPreferences.get("bootloader.path").equals("caterina")) {
|
||||||
String caterinaUploadPort = null;
|
String caterinaUploadPort = null;
|
||||||
try {
|
try {
|
||||||
// Toggle 1200 bps on selected serial port to force board reset.
|
// Toggle 1200 bps on selected serial port to force board reset.
|
||||||
@ -178,7 +178,7 @@ public class AvrdudeUploader extends Uploader {
|
|||||||
// port reconnects (or timeout after a few seconds if the sketch port never comes back).
|
// port reconnects (or timeout after a few seconds if the sketch port never comes back).
|
||||||
// Doing this saves users from accidentally opening Serial Monitor on the soon-to-be-orphaned
|
// Doing this saves users from accidentally opening Serial Monitor on the soon-to-be-orphaned
|
||||||
// bootloader port.
|
// bootloader port.
|
||||||
if (true == avrdudeResult && boardPreferences.get("bootloader.path").equals("caterina")) {
|
if (true == avrdudeResult && boardPreferences.get("bootloader.path") != null && boardPreferences.get("bootloader.path").equals("caterina")) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
} catch (InterruptedException ex) { }
|
} catch (InterruptedException ex) { }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user