Skip to content

Commit 01735b3

Browse files
lukostyraarapte
authored andcommitted
8265835: Exception in Quantum due to null platformWindow
Reviewed-by: arapte
1 parent 748107a commit 01735b3

File tree

1 file changed

+5
-3
lines changed
  • modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum

1 file changed

+5
-3
lines changed

modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/GlassScene.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -335,13 +335,15 @@ public final synchronized boolean getDoPresent() {
335335

336336
protected Color getClearColor() {
337337
WindowStage windowStage = stage instanceof WindowStage ? (WindowStage)stage : null;
338-
if (windowStage != null && windowStage.getPlatformWindow().isTransparentWindow()) {
338+
if (windowStage != null && windowStage.getPlatformWindow() != null &&
339+
windowStage.getPlatformWindow().isTransparentWindow()) {
339340
return (Color.TRANSPARENT);
340341
} else {
341342
if (fillPaint == null) {
342343
return Color.WHITE;
343344
} else if (fillPaint.isOpaque() ||
344-
(windowStage != null && windowStage.getPlatformWindow().isUnifiedWindow())) {
345+
(windowStage != null && windowStage.getPlatformWindow() != null &&
346+
windowStage.getPlatformWindow().isUnifiedWindow())) {
345347
//For bare windows the transparent fill is allowed
346348
if (fillPaint.getType() == Paint.Type.COLOR) {
347349
return (Color)fillPaint;

0 commit comments

Comments
 (0)