NullPointerException in AsyncTask where value is checked <p>I am developing app in Google play. My app have "Google Analytics" and I see in Exceptions:</p> <p>NullPointerException (@AsyncDownload:onPostExecute:70)</p> <p>Where is the problem ? </p> <pre><code>public class AsyncDownload extends AsyncTask&lt;String, Void, Feed &gt; { private FragmentCallback mFragmentCallback; public AsyncDownload(FragmentCallback fragmentCallback) { mFragmentCallback = fragmentCallback; } @Override protected void onPreExecute() { super.onPreExecute(); } @Override protected Void doInBackground(String... arg0) { Feed feed = ArticlesManager.getInstance().getFeed(arg0[0]); if(feed==null){ try { HttpGet get = new HttpGet(Ipsum.Headlines[Integer.valueOf(arg0[0])][2]); HttpParams httpParameters = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParameters, 3000); HttpConnectionParams.setSoTimeout(httpParameters, 5000); HttpClient hc = new DefaultHttpClient(); HttpResponse rp = hc.execute(get); if (rp.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { String res = EntityUtils.toString(rp.getEntity(),HTTP.UTF_8); Feed feed = RssReader.read(res,Integer.valueOf(arg0[0]) == 7); ArticlesManager.getInstance().addFeed(arg0[0], feed); } } catch (Exception e) { e.printStackTrace(); } } return null; } protected void onPostExecute(final Feed feed){ if(mFragmentCallback != null) { mFragmentCallback.onTaskDone(feed); } } </code></pre> <p>}</p>