package mansonheart.com.realmrxnotifications.presenter;

import com.hannesdorfmann.mosby.mvp.MvpBasePresenter;
import com.hannesdorfmann.mosby.mvp.MvpView;

import rx.subscriptions.CompositeSubscription;

/**
 * Created by Zherebtsov Alexandr on 08.01.2016.
 */
public abstract class RxBasePresenter<V extends MvpView> extends MvpBasePresenter<V> {

    CompositeSubscription compositeSubscription;

    protected void unsubscribe() {
        if (compositeSubscription != null && !compositeSubscription.isUnsubscribed()) {
            compositeSubscription.unsubscribe();
        }
        compositeSubscription = null;
    }

    @Override
    public void detachView(boolean retainInstance) {
        super.detachView(retainInstance);
        unsubscribe();
    }
}

@@ -620,16 +620,167 @@
 %0A    %7D%0A%0A
+    @Override%0A    public void attachView(V view) %7B%0A        super.attachView(view);%0A        compositeSubscription = new CompositeSubscription();%0A    %7D%0A%0A
     @Ove

Fix null