From 86e2a245b9f1c83b70f4083b1c2f0aaa3e0c16a2 Mon Sep 17 00:00:00 2001
From: Marco Antonio Villegas Vega <marvil07@gmail.com>
Date: Fri, 10 Jul 2009 07:37:48 -0500
Subject: [PATCH] avoid exception on SimpleXMLElement constructor

if we pass null to SimpleXMLElement constructor we get and exception, so if
something happened avoid the exception
---
 twitter.inc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/twitter.inc b/twitter.inc
index 5c6fc65..3f5b204 100644
--- a/twitter.inc
+++ b/twitter.inc
@@ -474,6 +474,10 @@ function twitter_user_delete($uid, $screen_name = NULL) {
 
 function _twitter_convert_xml_to_array($data) {
   $results = array();
+  if (is_null($data)) {
+    // avoid exception on SimpleXMLElement constructor
+    return $results;
+  }
   $xml = new SimpleXMLElement($data);
   if (!empty($xml->name)) {
     // Top-level user information.
-- 
1.5.6.5

