1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-29 18:52:13 +01:00

Merge pull request #94 from feka/master

Fixed nullpointer exception in case of missing bootloader.path param

http://code.google.com/p/arduino/issues/detail?id=919
This commit is contained in:
David A. Mellis 2012-06-06 06:26:28 -07:00
commit 002baa78f1

View File

@ -85,7 +85,7 @@ public class AvrdudeUploader extends Uploader {
// 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
// sketch.
if (boardPreferences.get("bootloader.path").equals("caterina")) {
if (boardPreferences.get("bootloader.path") != null && boardPreferences.get("bootloader.path").equals("caterina")) {
String caterinaUploadPort = null;
try {
// 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).
// Doing this saves users from accidentally opening Serial Monitor on the soon-to-be-orphaned
// 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 {
Thread.sleep(500);
} catch (InterruptedException ex) { }