Author: ningjiang
Date: Wed Sep  7 03:27:35 2011
New Revision: 1165987

URL: http://svn.apache.org/viewvc?rev=1165987&view=rev
Log:
CAMEL-4422 Fixed the NPE issue of camel-smpp when sending the message length is 
less then 255

Modified:
    
camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppBinding.java

Modified: 
camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppBinding.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppBinding.java?rev=1165987&r1=1165986&r2=1165987&view=diff
==============================================================================
--- 
camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppBinding.java
 (original)
+++ 
camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppBinding.java
 Wed Sep  7 03:27:35 2011
@@ -100,6 +100,8 @@ public class SmppBinding {
             
             if (shortMessage.length < 255) {
                 submitSm.setShortMessage(shortMessage);
+                // To avoid the NPE error
+                submitSm.setOptionalParametes(new OptionalParameter[]{});
             } else {
                 submitSm.setShortMessage(new byte[0]);
                 OptionalParameter messagePayloadTLV = 
OptionalParameters.deserialize(OptionalParameter.Tag.MESSAGE_PAYLOAD.code(), 
shortMessage);
@@ -306,4 +308,4 @@ public class SmppBinding {
     public void setConfiguration(SmppConfiguration configuration) {
         this.configuration = configuration;
     }
-}
\ No newline at end of file
+}


Reply via email to