Hardened upload.tool property reading code for boards.txt

Fixes #1464
This commit is contained in:
Cristian Maglie 2013-07-12 20:05:58 +02:00
parent 8ab419fd13
commit 7f87574f7e
2 changed files with 9 additions and 1 deletions

View File

@ -2433,6 +2433,10 @@ public class Editor extends JFrame implements RunnerListener {
if (serialMenu.getItemCount() == 0) statusError(e);
else if (serialPrompt()) run();
else statusNotice(_("Upload canceled."));
} catch (PreferencesMapException e) {
statusError(I18n.format(
_("Error while uploading: missing '{0}' configuration parameter"),
e.getMessage()));
} catch (RunnerException e) {
//statusError("Error during upload.");
//e.printStackTrace();
@ -2469,6 +2473,10 @@ public class Editor extends JFrame implements RunnerListener {
if (serialMenu.getItemCount() == 0) statusError(e);
else if (serialPrompt()) run();
else statusNotice(_("Upload canceled."));
} catch (PreferencesMapException e) {
statusError(I18n.format(
_("Error while uploading: missing '{0}' configuration parameter"),
e.getMessage()));
} catch (RunnerException e) {
//statusError("Error during upload.");
//e.printStackTrace();

View File

@ -51,7 +51,7 @@ public class BasicUploader extends Uploader {
TargetPlatform targetPlatform = Base.getTargetPlatform();
PreferencesMap prefs = Preferences.getMap();
prefs.putAll(Base.getBoardPreferences());
prefs.putAll(targetPlatform.getTool(prefs.get("upload.tool")));
prefs.putAll(targetPlatform.getTool(prefs.getOrExcept("upload.tool")));
// if no protocol is specified for this board, assume it lacks a
// bootloader and upload using the selected programmer.