← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11186: Null check for sms sending

 

------------------------------------------------------------
revno: 11186
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-06-10 13:33:06 +0200
message:
  Null check for sms sending
modified:
  dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java	2013-05-30 09:49:45 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java	2013-06-10 11:33:06 +0000
@@ -92,6 +92,11 @@
     @Override
     public String sendMessage( String subject, String text, User sender, Set<User> users, boolean forceSend )
     {
+        if ( transportService == null || SmsLibService.gatewayMap == null || SmsLibService.gatewayMap.get( "bulk_gw" ) == null )
+        {
+            return null;
+        }
+        
         String message = null;
 
         Set<User> toSendList = new HashSet<User>();
@@ -141,6 +146,7 @@
 
             }
         }
+        
         return message;
     }