Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/src/processing/app/SketchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,10 @@ private boolean upload(String suggestedClassName, boolean usingProgrammer) throw

UploaderUtils uploaderInstance = new UploaderUtils();
Uploader uploader = uploaderInstance.getUploaderByPreferences(false);
if (uploader == null) {
editor.statusError(tr("Please select a Port before Upload"));
return false;
}

EditorConsole.setCurrentEditorConsole(editor.console);

Expand Down
11 changes: 10 additions & 1 deletion arduino-core/src/cc/arduino/UploaderUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,16 @@ public Uploader getUploaderByPreferences(boolean noUploadPort) {

BoardPort boardPort = null;
if (!noUploadPort) {
boardPort = BaseNoGui.getDiscoveryManager().find(PreferencesData.get("serial.port"));
String port = PreferencesData.get("serial.port");
if (port == null || port.isEmpty()) {
return null;
}
boardPort = BaseNoGui.getDiscoveryManager().find(port);
//if (boardPort == null) {
// Is there ever a reason to attempt upload when
// the Port is not found by DiscoveryManager?
//return null;
//}
}

return new UploaderFactory().newUploader(target.getBoards().get(board), boardPort, noUploadPort);
Expand Down