mirror of
https://github.com/nextcloud/talk-android
synced 2025-02-02 20:53:09 +00:00
Simplified code to avoid NullPointerException when server response arrives after the view was unbound.
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
This commit is contained in:
parent
606c6b0b9e
commit
d064ad3f65
@ -528,7 +528,7 @@ public class ConversationsListController extends BaseController implements Searc
|
||||
// This is invoked asynchronously, when server returns a response the view might have been
|
||||
// unbound in the meantime. Check if the view is still there.
|
||||
// FIXME - does it make sense to update internal data structures even when view has been unbound?
|
||||
if (!viewIsBound()) {
|
||||
if (getView() == null) {
|
||||
Log.d(TAG, "fetchData - getRooms - view is not bound: " + startNanoTime);
|
||||
return;
|
||||
}
|
||||
|
@ -55,8 +55,4 @@ abstract class ButterKnifeController : Controller {
|
||||
unbinder!!.unbind()
|
||||
unbinder = null
|
||||
}
|
||||
|
||||
protected fun viewIsBound() : Boolean {
|
||||
return unbinder != null
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user