From ec3c8123bf5f707a9b3d08a4c65eda75a9831405 Mon Sep 17 00:00:00 2001 From: Tibor Fekete Date: Mon, 4 Jun 2012 21:27:13 +0200 Subject: [PATCH] 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. --- app/src/processing/app/debug/AvrdudeUploader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/processing/app/debug/AvrdudeUploader.java b/app/src/processing/app/debug/AvrdudeUploader.java index 213e17896e1..b88f6a82977 100755 --- a/app/src/processing/app/debug/AvrdudeUploader.java +++ b/app/src/processing/app/debug/AvrdudeUploader.java @@ -85,7 +85,7 @@ private boolean uploadViaBootloader(String buildPath, String className) // 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 @@ private boolean uploadViaBootloader(String buildPath, String className) // 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) { }