From e1f40e950190de3a11649e9fae283e172879c5c5 Mon Sep 17 00:00:00 2001 From: Shadi Shaheen Date: Thu, 14 May 2020 14:29:02 +0300 Subject: [PATCH] fixed NPE --- jfoenix/src/main/java/com/jfoenix/controls/JFXSnackbar.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jfoenix/src/main/java/com/jfoenix/controls/JFXSnackbar.java b/jfoenix/src/main/java/com/jfoenix/controls/JFXSnackbar.java index bed5142d..f16e3cad 100644 --- a/jfoenix/src/main/java/com/jfoenix/controls/JFXSnackbar.java +++ b/jfoenix/src/main/java/com/jfoenix/controls/JFXSnackbar.java @@ -340,6 +340,9 @@ private void processSnackbar() { } private void refreshPopup() { + if (snackbarContainer == null) { + return; + } Bounds contentBound = this.getLayoutBounds(); double offsetX = Math.ceil(snackbarContainer.getWidth() / 2) - Math.ceil(contentBound.getWidth() / 2); double offsetY = snackbarContainer.getHeight() - contentBound.getHeight();