Mercurial > hg > monetdb-java
comparison src/main/java/org/monetdb/jdbc/MonetConnection.java @ 540:d3a96675969e onclient
Handle case where in.readLine() returns null
author | Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com> |
---|---|
date | Thu, 02 Sep 2021 13:51:04 +0200 (2021-09-02) |
parents | 5d524783f7b0 |
children | 31df6a12fd41 |
comparison
equal
deleted
inserted
replaced
539:5d524783f7b0 | 540:d3a96675969e |
---|---|
3146 // Consume the command | 3146 // Consume the command |
3147 String transferCommand = in.readLine(); | 3147 String transferCommand = in.readLine(); |
3148 // Consume the fake prompt inserted by MapiSocket. | 3148 // Consume the fake prompt inserted by MapiSocket. |
3149 String dummy = in.readLine(); | 3149 String dummy = in.readLine(); |
3150 // Handle the request | 3150 // Handle the request |
3151 error = handleTransfer(transferCommand); | 3151 if (transferCommand != null) |
3152 error = handleTransfer(transferCommand); | |
3153 else | |
3154 error = "!M0M10!protocol violation, expected transfer command, got nothing"; | |
3152 // Then prepare for the next iteration | 3155 // Then prepare for the next iteration |
3153 if (error != null) { | 3156 if (error != null) { |
3154 out.writeLine("!HY000!" + error + "\n"); | 3157 out.writeLine("!HY000!" + error + "\n"); |
3155 error = in.waitForPrompt(); | 3158 error = in.waitForPrompt(); |
3156 } else { | 3159 } else { |