mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01: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
|
// 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.
|
// 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?
|
// 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);
|
Log.d(TAG, "fetchData - getRooms - view is not bound: " + startNanoTime);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -55,8 +55,4 @@ abstract class ButterKnifeController : Controller {
|
|||||||
unbinder!!.unbind()
|
unbinder!!.unbind()
|
||||||
unbinder = null
|
unbinder = null
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun viewIsBound() : Boolean {
|
|
||||||
return unbinder != null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user