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
2 changes: 1 addition & 1 deletion app/src/cc/arduino/packages/UploaderAndMonitorFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
public class UploaderAndMonitorFactory {

public Uploader newUploader(TargetBoard board, BoardPort port) {
if ("true".equals(board.getPreferences().get("upload.via_ssh")) && "network".equals(port.getProtocol())) {
if ("true".equals(board.getPreferences().get("upload.via_ssh")) && port != null && "network".equals(port.getProtocol())) {
return new SSHUploader(port);
}

Expand Down
6 changes: 6 additions & 0 deletions app/src/cc/arduino/packages/uploaders/SerialUploader.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
String pattern = prefs.getOrExcept("upload.pattern");
String[] cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
uploadResult = executeUploadCommand(cmd);
} catch (RunnerException e) {
throw e;
} catch (Exception e) {
throw new RunnerException(e);
}
Expand Down Expand Up @@ -228,6 +230,8 @@ public boolean uploadUsingProgrammer(String buildPath, String className) throws
String pattern = prefs.getOrExcept("program.pattern");
String[] cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
return executeUploadCommand(cmd);
} catch (RunnerException e) {
throw e;
} catch (Exception e) {
throw new RunnerException(e);
}
Expand Down Expand Up @@ -287,6 +291,8 @@ public boolean burnBootloader() throws Exception {
pattern = prefs.getOrExcept("bootloader.pattern");
cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
return executeUploadCommand(cmd);
} catch (RunnerException e) {
throw e;
} catch (Exception e) {
throw new RunnerException(e);
}
Expand Down
5 changes: 0 additions & 5 deletions app/src/processing/app/Sketch.java
Original file line number Diff line number Diff line change
Expand Up @@ -1692,11 +1692,6 @@ protected boolean upload(String buildPath, String suggestedClassName, boolean us

BoardPort boardPort = Base.getDiscoveryManager().find(Preferences.get("serial.port"));

if (boardPort == null) {
editor.statusError(I18n.format("Board at {0} is not available", Preferences.get("serial.port")));
return false;
}

Uploader uploader = new UploaderAndMonitorFactory().newUploader(target.getBoards().get(board), boardPort);

boolean success = false;
Expand Down