Android RunTimeException when returning contact picker results?
<p>I am getting this error when trying to retrieve the returned results from the contacts picker.</p>

<pre><code>10-18 09:03:14.704: ERROR/AndroidRuntime(14003): Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1001, result=-1, data=Intent { dat=content://com.android.contacts/data/42 flg=0x1 (has extras) }} to activity {com.fttech/com.fttech.EditCreate}: java.lang.NullPointerException
</code></pre>

<p>Here is how i am retrieving the results and returning the selected contact. It only does this for certain contacts.</p>

<pre><code>    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        switch (requestCode) {  
        case (CONTACT_PICKER_RESULT):  
            if (resultCode == Activity.RESULT_OK) {  
                Uri contactData = data.getData();  
                Cursor contact = managedQuery(contactData, null, null, null, null);  
                if (contact.moveToFirst()) {  
                  number = contact.getString(contact.getColumnIndexOrThrow(Phone.NUMBER));

                  if(currentNumber.isEmpty()){
                      numbers.setText(number);
                  }else{
                       numbers.setText(currentNumber +","+number);
                  }
                }  
            }  
            break;  

        }//getContactInfo
</code></pre>

<p>How do i fix this or code defensively against this?</p>
