Fix Uncaught TypeError: Cannot call method 'getAttribute' of undefined

https://app.getsentry.com/id/id/group/5151824/
This commit is contained in:
John Firebaugh
2013-04-25 12:16:32 -07:00
parent fdd49233b1
commit f1d32dd65e

View File

@@ -255,7 +255,7 @@ iD.Connection = function() {
var u = user_details.getElementsByTagName('user')[0],
img = u.getElementsByTagName('img'),
image_url = '';
if (img && img[0].getAttribute('href')) {
if (img && img[0] && img[0].getAttribute('href')) {
image_url = img[0].getAttribute('href');
}
callback(undefined, connection.user({