Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 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,11 @@ 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);
}

return new UploaderFactory().newUploader(target.getBoards().get(board), boardPort, noUploadPort);
Expand Down
3 changes: 2 additions & 1 deletion build/shared/lib/preferences.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ programmer = arduino:avrispmkii
upload.using = bootloader
upload.verify = true

serial.port=COM1
#default port is empty to prevent running AVRDUDE before Port selected (issue #7943)
serial.port=
serial.databits=8
serial.stopbits=1
serial.parity=N
Expand Down