Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24b5a930 authored by Gitsaibot's avatar Gitsaibot Committed by Jochen Sprickerhof
Browse files

Prevent NPE in Search and Select Calendar Activity. Solves #102

parent 72e5fe32
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -111,11 +111,13 @@ public class SearchActivity extends AppCompatActivity implements CalendarControl
        mContentResolver = getContentResolver();

        if (mIsMultipane) {
            getSupportActionBar().setDisplayOptions(
                    ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP);
            if (getSupportActionBar() != null) {
                getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP);
            }
        } else {
            getSupportActionBar().setDisplayOptions(0,
                    ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME);
            if (getSupportActionBar() != null) {
               getSupportActionBar().setDisplayOptions(0, ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME);
            }
        }

        // Must be the first to register because this activity can modify the
+3 −2
Original line number Diff line number Diff line
@@ -101,8 +101,9 @@ public class SelectVisibleCalendarsActivity extends AbstractCalendarActivity {

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getSupportActionBar()
                .setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP);
        if (getSupportActionBar() != null) {
            getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP);
        }
        return true;
    }