Fix possible NPE on wallpaper change.
This commit is contained in:
parent
18ede2e900
commit
d844fa0fb5
1 changed files with 7 additions and 3 deletions
|
@ -394,8 +394,12 @@ public class ConversationFragment extends LoggingFragment {
|
|||
|
||||
public void onWallpaperChanged(@Nullable ChatWallpaper wallpaper) {
|
||||
if (list != null) {
|
||||
Log.d(TAG, "Notifying adapter that wallpaper state has changed.");
|
||||
getListAdapter().onHasWallpaperChanged(wallpaper != null);
|
||||
ConversationAdapter adapter = getListAdapter();
|
||||
|
||||
if (adapter != null) {
|
||||
Log.d(TAG, "Notifying adapter that wallpaper state has changed.");
|
||||
getListAdapter().onHasWallpaperChanged(wallpaper != null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -624,7 +628,7 @@ public class ConversationFragment extends LoggingFragment {
|
|||
menu.findItem(R.id.menu_context_copy).setVisible(menuState.shouldShowCopyAction());
|
||||
}
|
||||
|
||||
private ConversationAdapter getListAdapter() {
|
||||
private @Nullable ConversationAdapter getListAdapter() {
|
||||
return (ConversationAdapter) list.getAdapter();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue