From 5f1c097aae4a1b0dd3501c0298e5d9a49b8e055f Mon Sep 17 00:00:00 2001
From: Ray <ray.li.verified@gmail.com>
Date: Mon, 21 Aug 2017 16:28:07 -0500
Subject: [PATCH] QUICKFIX Builder Crash When Null

*Fix NPE when builder is null and dialogue is created.
---
 build.gradle                                      |  2 --
 customalert/build.gradle                          |  2 +-
 .../stream/customalert/CustomAlertDialogue.java   | 15 +++++++++------
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/build.gradle b/build.gradle
index 5fd14a7..a65373c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,5 +1,3 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
 buildscript {
     repositories {
         jcenter()
diff --git a/customalert/build.gradle b/customalert/build.gradle
index 31b090f..89686c6 100644
--- a/customalert/build.gradle
+++ b/customalert/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
 apply plugin: 'com.github.dcendents.android-maven'
 
 group='com.github.searchy2'
-version = '1.5'
+version = '1.6'
 
 android {
     compileSdkVersion 25
diff --git a/customalert/src/main/java/stream/customalert/CustomAlertDialogue.java b/customalert/src/main/java/stream/customalert/CustomAlertDialogue.java
index 75d99cc..f68c1d0 100644
--- a/customalert/src/main/java/stream/customalert/CustomAlertDialogue.java
+++ b/customalert/src/main/java/stream/customalert/CustomAlertDialogue.java
@@ -62,13 +62,16 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
         }
         setStyle(DialogFragment.STYLE_NO_TITLE, R.style.CustomDialog);
         setRetainInstance(true);
-        if (builder.getCancelable() == false)
-        {
-            this.setCancelable(false);
-        }
-        else
+        if (builder != null)
         {
-            this.setCancelable(true);
+            if (!builder.getCancelable())
+            {
+                this.setCancelable(false);
+            }
+            else
+            {
+                this.setCancelable(true);
+            }
         }
         super.onCreate(savedInstanceState);
     }