Commit 09e50dba authored by Sajal Narang's avatar Sajal Narang

Fix NPE in MapFragment

parent b200717f
...@@ -94,6 +94,7 @@ import retrofit2.Call; ...@@ -94,6 +94,7 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
import static android.widget.Toast.LENGTH_SHORT;
import static app.insti.Constants.MY_PERMISSIONS_REQUEST_LOCATION; import static app.insti.Constants.MY_PERMISSIONS_REQUEST_LOCATION;
public class MapFragment extends Fragment implements TextWatcher, public class MapFragment extends Fragment implements TextWatcher,
...@@ -490,7 +491,7 @@ public class MapFragment extends Fragment implements TextWatcher, ...@@ -490,7 +491,7 @@ public class MapFragment extends Fragment implements TextWatcher,
@Override @Override
public void onItemClick(AdapterView<?> arg0, View arg1, int id, long arg3) { public void onItemClick(AdapterView<?> arg0, View arg1, int id, long arg3) {
if (adapter.getResultSize() == 0) { if (adapter.getResultSize() == 0) {
toast.setText(message); toast = Toast.makeText(getContext(), message, LENGTH_SHORT);
toast.show(); toast.show();
} else { } else {
String selection = editText.getText().toString(); String selection = editText.getText().toString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment