Skip to content

Commit

Permalink
Fixed #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Guichaguri committed Jan 7, 2018
1 parent d357e23 commit e122bd4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/guichaguri/minimalftp/FTPConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,12 @@ public void enableSSL(SSLContext context) throws IOException {
public void sendResponse(int code, String response) {
if(con.isClosed()) return;

if(response == null || response.isEmpty()) {
response = "Unknown";
}

try {
if(!response.isEmpty() && response.charAt(0) == '-') {
if(response.charAt(0) == '-') {
writer.write(code + response + "\r\n");
} else {
writer.write(code + " " + response + "\r\n");
Expand Down

0 comments on commit e122bd4

Please sign in to comment.