package hotchemi.android.rate;

import android.view.View;

import java.lang.ref.WeakReference;

final class DialogOptions {

    private boolean showNeutralButton = true;

    private boolean showTitle = true;

    private int titleResId = R.string.rate_dialog_title;

    private int messageResId = R.string.rate_dialog_message;

    private int textPositiveResId = R.string.rate_dialog_ok;

    private int textNeutralResId = R.string.rate_dialog_cancel;

    private int textNegativeResId = R.string.rate_dialog_no;

    private WeakReference<View> view;

    private WeakReference<OnClickButtonListener> listener;

    public boolean shouldShowNeutralButton() {
        return showNeutralButton;
    }

    public void setShowNeutralButton(boolean showNeutralButton) {
        this.showNeutralButton = showNeutralButton;
    }

    public boolean shouldShowTitle() {
        return showTitle;
    }

    public void setShowTitle(boolean showTitle) {
        this.showTitle = showTitle;
    }

    public int getTitleResId() {
        return titleResId;
    }

    public void setTitleResId(int titleResId) {
        this.titleResId = titleResId;
    }

    public int getMessageResId() {
        return messageResId;
    }

    public void setMessageResId(int messageResId) {
        this.messageResId = messageResId;
    }

    public int getTextPositiveResId() {
        return textPositiveResId;
    }

    public void setTextPositiveResId(int textPositiveResId) {
        this.textPositiveResId = textPositiveResId;
    }

    public int getTextNeutralResId() {
        return textNeutralResId;
    }

    public void setTextNeutralResId(int textNeutralResId) {
        this.textNeutralResId = textNeutralResId;
    }

    public int getTextNegativeResId() {
        return textNegativeResId;
    }

    public void setTextNegativeResId(int textNegativeResId) {
        this.textNegativeResId = textNegativeResId;
    }

    public View getView() {
        return view.get();
    }

    public void setView(View view) {
        this.view = new WeakReference<>(view);
    }

    public OnClickButtonListener getListener() {
        return listener.get();
    }

    public void setListener(OnClickButtonListener listener) {
        this.listener = new WeakReference<>(listener);
    }

}

@@ -1946,24 +1946,87 @@
 getView() %7B%0A
+        if (view == null) %7B%0A            return null;%0A        %7D%0A
         retu
@@ -2183,24 +2183,91 @@
 istener() %7B%0A
+        if (listener == null) %7B%0A            return null;%0A        %7D%0A
         retu

Fix to avoid null references.