Author: amilas
Date: Sun Mar  7 11:16:14 2010
New Revision: 919967

URL: http://svn.apache.org/viewvc?rev=919967&view=rev
Log:
fixing the issue AXIS2-4641. added a null check for message context.

Modified:
    
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java

Modified: 
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java?rev=919967&r1=919966&r2=919967&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
 Sun Mar  7 11:16:14 2010
@@ -293,12 +293,13 @@
             SimpleDateFormat zulu = new SimpleDateFormat("yyyy-MM-dd");
 
             MessageContext messageContext = 
MessageContext.getCurrentMessageContext();
-            AxisService axisServce = messageContext.getAxisService();
-            // if the user has given a pirticualr timezone we use it.
-            if (axisServce.getParameter("TimeZone") != null){
-               
zulu.setTimeZone(TimeZone.getTimeZone((String)axisServce.getParameter("TimeZone").getValue()));
+            if (messageContext != null) {
+                AxisService axisServce = messageContext.getAxisService();
+                // if the user has given a pirticualr timezone we use it.
+                if (axisServce.getParameter("TimeZone") != null) {
+                    zulu.setTimeZone(TimeZone.getTimeZone((String) 
axisServce.getParameter("TimeZone").getValue()));
+                }
             }
-
             return zulu.format(obj);
         }
         return obj.toString();


Reply via email to