Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix NPE when we don't know the sender of an event #430

Merged
merged 1 commit into from
Aug 25, 2016

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Aug 25, 2016

Fixes a bug introduced in #426.

Particularly when we are showing search results, we may not recognise the sender of an event; attempting to create a MemberAvatar for it will lead to null-reference errors.

Also a bit of untangling of the logic of needsSenderProfile. Since #422, EventTileType.needsSenderProfile was only being called on MessageEvents, and therefore only returned true. It's a shame to see all this logic going into EventTile rather than the individual EventTileTypes, but since it's there, let's not leave the unused logic lying around in the EventTileType implementations.

Fixes a bug introduced in
#426.

Particularly when we are showing search results, we may not recognise the
sender of an event; attempting to create a MemberAvatar for it will lead to
null-reference errors.

Also a bit of untangling of the logic of needsSenderProfile. Since
#422,
EventTileType.needsSenderProfile was only being called on MessageEvents, and
therefore only returned true. It's a shame to see all this logic going into
EventTile rather than the individual EventTileTypes, but since it's there,
let's not leave the unused logic lying around in the EventTileType
implementations.
@ara4n
Copy link
Member

ara4n commented Aug 25, 2016

lgtm

@richvdh richvdh merged commit c8b2d51 into develop Aug 25, 2016
@richvdh richvdh deleted the rav/fix_search_regression branch September 2, 2016 10:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants