Skip to content

Commit ec3c812

Browse files
committed
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.
1 parent a9fedab commit ec3c812

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/processing/app/debug/AvrdudeUploader.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private boolean uploadViaBootloader(String buildPath, String className)
8585
// this wait a moment for the bootloader to enumerate. On Windows, also must
8686
// deal with the fact that the COM port number changes from bootloader to
8787
// sketch.
88-
if (boardPreferences.get("bootloader.path").equals("caterina")) {
88+
if (boardPreferences.get("bootloader.path") != null && boardPreferences.get("bootloader.path").equals("caterina")) {
8989
String caterinaUploadPort = null;
9090
try {
9191
// Toggle 1200 bps on selected serial port to force board reset.
@@ -178,7 +178,7 @@ private boolean uploadViaBootloader(String buildPath, String className)
178178
// port reconnects (or timeout after a few seconds if the sketch port never comes back).
179179
// Doing this saves users from accidentally opening Serial Monitor on the soon-to-be-orphaned
180180
// bootloader port.
181-
if (true == avrdudeResult && boardPreferences.get("bootloader.path").equals("caterina")) {
181+
if (true == avrdudeResult && boardPreferences.get("bootloader.path") != null && boardPreferences.get("bootloader.path").equals("caterina")) {
182182
try {
183183
Thread.sleep(500);
184184
} catch (InterruptedException ex) { }

0 commit comments

Comments
 (0)