Author: siwuzzz
Date: Mon May 14 20:43:26 2007
New Revision: 150

Modified:
   trunk/clients/cs/src/gapps/appsexception.cs

Log:
appsexception.cs:
Fixed a case where a ArgumentNullException were thrown because when 
GDataRequestException.ResponseString was null.

Modified: trunk/clients/cs/src/gapps/appsexception.cs
==============================================================================
--- trunk/clients/cs/src/gapps/appsexception.cs (original)
+++ trunk/clients/cs/src/gapps/appsexception.cs Mon May 14 20:43:26 2007
@@ -200,31 +200,34 @@
         {
             AppsException result = null;
 
-            if (e != null)
-            {
-                try
-                {
-                    XmlReader reader = new XmlTextReader(e.ResponseString, 
XmlNodeType.Document, null);
-                    // now find the ErrorElement
-                    while (reader.Read())
-                        if (reader.NodeType == XmlNodeType.Element && 
reader.LocalName == AppsNameTable.XmlElementError)
-                        {
-                            result = new AppsException(e);
-                            result.ErrorCode =
-                                
reader.GetAttribute(AppsNameTable.XmlAttributeErrorErrorCode);
-                            result.InvalidInput =
-                                
reader.GetAttribute(AppsNameTable.XmlAttributeErrorInvalidInput);
-                            result.Reason =
-                                
reader.GetAttribute(AppsNameTable.XmlAttributeErrorReason);
-                            break;
-                        }
-                }
-                catch (XmlException)
-                {
-                       
-                }
-            }
+            if (e == null)
+                return (null);
 
+            if (e.ResponseString == null)
+                return (null);
+
+            try
+            {
+                XmlReader reader = new XmlTextReader(e.ResponseString, 
XmlNodeType.Document, null);
+                // now find the ErrorElement
+                while (reader.Read())
+                    if (reader.NodeType == XmlNodeType.Element && 
reader.LocalName == AppsNameTable.XmlElementError)
+                    {
+                        result = new AppsException(e);
+                        result.ErrorCode =
+                            
reader.GetAttribute(AppsNameTable.XmlAttributeErrorErrorCode);
+                        result.InvalidInput =
+                            
reader.GetAttribute(AppsNameTable.XmlAttributeErrorInvalidInput);
+                        result.Reason =
+                            
reader.GetAttribute(AppsNameTable.XmlAttributeErrorReason);
+                        break;
+                    }
+            }
+            catch (XmlException)
+            {
+                       
+            }
+
             return result;
         }
     }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Data API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to