check that getActionBar() is not null before calling method call