Parcourir la source

Sanity check in parseResponse

Baglio Tabifata il y a 5 ans
Parent
commit
876342bf58
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      src/net/hkzlab/dupal/dupalproto/DuPALProto.java

+ 2 - 1
src/net/hkzlab/dupal/dupalproto/DuPALProto.java

@@ -70,8 +70,9 @@ public class DuPALProto {
     }
 
     public static String[] parseResponse(String response) {
-        ArrayList<String> respString = new ArrayList<>();
+        if(response == null) return null;
 
+        ArrayList<String> respString = new ArrayList<>();        
         response = response.trim();
 
         if(response.equals(CMD_RESP_ERROR)) {