Buggy code:
public class MainActivity extends ActionBarActivity { private static final String TAG = MainActivity . class . getSimpleName ( ) ; public static final String BUFFER_STATE = "buffer_state" ; private static final String DRAWER_SELECTION = "drawer_selection" ; SharedPreferences preferences ; OnSharedPreferenceChangeListener sharedPreferenceChangeListener ; private DrawerLayout drawer ; private MainActivity . ExtensibleDrawerToggle extensibleDrawerToggle ; private MainActivity . ClickableActionBar actionbar ; private MainActivity . QuasselDroidFragmentManager manager = new MainActivity . QuasselDroidFragmentManager ( ) ; private int currentTheme ; private Boolean showLag = false ; private int lag = 0 ; private int openedBuffer = - 1 ; private int openedDrawer = Gravity . NO_GRAVITY ; private CharSequence topic ; private boolean bufferHasTopic ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Subscribe public void onBufferDetailsChanged ( BufferDetailsChangedEvent event ) { } @ Override protected void onPostCreate ( Bundle savedInstanceState ) { } void getState ( Bundle in ) { } @ Override protected void onStart ( ) { } @ Override protected void onResume ( ) { } private void loadBufferAndDrawerState ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onStop ( ) { } @ Override protected void onDestroy ( ) { } @ Override protected void onSaveInstanceState ( Bundle outState ) { } Bundle storeState ( Bundle in ) { } @ Override public void onConfigurationChanged ( Configuration newConfig ) { } @ Override public boolean onSearchRequested ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Subscribe public void onInitProgressed ( InitProgressEvent event ) { FragmentManager fm = getSupportFragmentManager ( ) ; Fragment currentFragment = fm . findFragmentById ( main_content_container ) ; if ( event . done ) { manager . initMainFragment ( ) ; loadBufferAndDrawerState ( ) ; manager . hideKeyboard ( ) ; setTitleAndMenu ( ) ; } else <START_BUG> if ( ( currentFragment == null ) || ( ( currentFragment . getClass ( ) ) != ( ConnectingFragment . class ) ) ) { <END_BUG> Log . d ( MainActivity . TAG , "Showing<seq2seq4repair_space>progress" ) ; showInitProgress ( ) ; } } @ Subscribe public void onLatencyChanged ( LatencyChangedEvent event ) { } public void updateSubtitle ( ) { } private boolean emptyString ( CharSequence topic ) { } private void showDetailPopup ( ) { } @ Subscribe public void onConnectionChanged ( ConnectionChangedEvent event ) { } private void returnToLogin ( ) { } private void showInitProgress ( ) { } @ Subscribe public void onBufferOpened ( BufferOpenedEvent event ) { } private void setTitleAndMenu ( ) { } @ Produce public BufferOpenedEvent produceBufferOpenedEvent ( ) { } @ Subscribe public void onBufferRemoved ( BufferRemovedEvent event ) { } class QuasselDroidFragmentManager { Fragment chatFragment ; Fragment nickFragment ; Fragment detailFragment ; Fragment bufferFragment ; SparseArray < Fragment > drawers = new SparseArray < Fragment > ( ) ; private boolean hasDrawer ; void preInit ( ) { } void init ( ) { } void initMainFragment ( ) { } void setPanelFragment ( int side , Fragment fragment ) { } void lockDrawer ( int side , boolean locked ) { } public void setWindowProperties ( int side ) { } public int getOpenDrawers ( ) { } public int getOpenDrawers ( DrawerLayout drawer ) { } public void closeDrawerOpposite ( View drawerView ) { } public void openDrawer ( int openedDrawer ) { } public void cleanup ( ) { } public void cleanupMenus ( ) { } public void setupDrawer ( ) { } public void hideKeyboard ( ) { } public void hideKeyboard ( View view ) { } public void closeDrawer ( int side ) { } } private void updateBufferRead ( ) { } class ExtensibleDrawerToggle { ActionBarDrawerToggle drawerToggle ; DrawerLayout drawer ; ExtensibleDrawerToggle ( DrawerLayout drawer , final ActionBarDrawerToggle drawerToggle ) { } DrawerListener getDrawerListener ( ) { } DrawerLayout getDrawer ( ) { } } class ClickableActionBar { Toolbar wrappedToolbar ; Context context ; ClickableActionBar ( Context context , Toolbar toolbar ) { } public Toolbar getWrappedToolbar ( ) { } public boolean isSubtitleVisible ( ) { } public void setSubtitleVisible ( boolean subtitleVisibility ) { } public CharSequence getTitle ( ) { } public void setOnTitleClickListener ( View . OnClickListener listener ) { } public void setTitle ( CharSequence subtitle ) { } public CharSequence getSubtitle ( ) { } public void setSubtitle ( CharSequence subtitle ) { } public boolean isTitleClickable ( ) { } public void setTitleClickable ( boolean clickable ) { } } private ServiceConnection focusConnection ; No newline ; at end ; of file ; }

Fix:
if ( currentFragment == null ) {