Check for null activity before proceeding with AsyncTask. Fixes #18