Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE when provider not return protocol version on bind response: 0000001e8000000200000000000000016d6178696d6174656c65636f6d00 #43

Open
vharseko opened this issue Feb 7, 2015 · 2 comments

Comments

@vharseko
Copy link

vharseko commented Feb 7, 2015

diff --git a/jsmpp/src/main/java/org/jsmpp/bean/OptionalParameters.java b/jsmpp/src/main/java/org/jsmpp/bean/OptionalParameters.java
index b5f032f..d7d12bc 100644
--- a/jsmpp/src/main/java/org/jsmpp/bean/OptionalParameters.java
+++ b/jsmpp/src/main/java/org/jsmpp/bean/OptionalParameters.java
@@ -235,11 +235,12 @@
     @SuppressWarnings("unchecked")
     public static <U extends OptionalParameter> U get(Class<U> tagClass, OptionalParameter[] parameters)
     {
-        for(OptionalParameter i: parameters) {
-            if(i.getClass() == tagClass) {
-                return (U)i;
-            }
-        }
+       if (parameters!=null)
+           for(OptionalParameter i: parameters) {
+               if(i.getClass() == tagClass) {
+                   return (U)i;
+               }
+           }
         logger.info("optional tag " + tagClass + " not found");
         return null;
     }
@ADTC
Copy link

ADTC commented Feb 8, 2015

Is this supposed to be some kind of weird pull request?

@ADTC
Copy link

ADTC commented Feb 8, 2015

Haha, please ignore my comment. But I think your post should explain what you're doing and why. Not show the diff (which we can already see in the actual pull request).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants