code: protected final void ifViewAttached(boolean exceptionIfViewNotAttached, ViewAction<V> action) {
      final V view = viewRef == null ? null : viewRef.get();
      if (view != null) {
        action.run(view);
      } else if (exceptionIfViewNotAttached) {
        throw new IllegalStateException(
            "No View attached to Presenter. Presenter destroyed = " + presenterDestroyed);
      }
    }
docs: Executes the passed Action only if the View is attached.
  If no View is attached, either an exception is thrown (if parameter exceptionIfViewNotAttached
  is true) or the action is just not executed (no exception thrown).
  Note that if no view is attached, this will not re-execute the given action if the View gets
  re-attached.
  
  @param exceptionIfViewNotAttached true, if an exception should be thrown if no view is
  attached while trying to execute the action. false, if no exception should be thrown (the action
  will not be executed since no view is attached)
  @param action The {@link ViewAction} that will be executed if a view is attached. This is
  where you call view.isLoading etc. Use the view reference passed as parameter to {@link
  ViewAction#run(Object)} and not deprecated method {@link #getView()}