Bug 718904 - Avoid crashing if longtap does not return a Cursor item. r=mfinkle

This commit is contained in:
Wes Johnston 2012-02-07 17:06:47 -08:00
parent b9befea8b7
commit caf2abb335

View File

@ -417,6 +417,10 @@ public class AwesomeBar extends Activity implements GeckoEventListener {
}
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
selectedItem = list.getItemAtPosition(info.position);
if (! (selectedItem instanceof Cursor)) {
Log.e(LOGTAG, "item at " + info.position + " is not a Cursor");
return;
}
Cursor cursor = (Cursor)selectedItem;
title = cursor.getString(cursor.getColumnIndexOrThrow(URLColumns.TITLE));
}