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();