PaNaVTEC/Clean-Contacts

presenter.getView() can be null

PaNaVTEC opened this issue · 1 comments

The Presenter.getView() can be null. Consider the case that the interactor result returns after call detachView. The view is null and the presenter is crashing, to solve it, return a NullObjectPattern of the View in the Presenter BaseClass to avoid undesired crashes.

If you want to save the results for later present, you need to handle this by your self in the presenter

this is solved with this modification in Presenter.java:

public void detachView() {
    view = ViewInjector.nullObjectPatternView(this);
  }```