             {
                 if (value == undefined || value is Error)
                 {
-                    callback(null);
+                    if (callback != null)
+                        callback(null);
                 }
                 else
                 {
-                    callback(response);
+                    if (callback != null)
+                        callback(response);
                 }
             };
 

            }
            else
            {
                callback(null);
            }
        }
        else
        {
            callback(null);
        }
    }


                {
                    if (value == undefined || value is Error)
                    {
                        if (callback != null)
                            callback(null);
                    }
                    else
                    {
                        if (callback != null)
                            callback(new Response(head, value));
                    }
                };

