8336879: Always true condition 'img != null' in GTKPainter.paintPopupMenuBackground

Reviewed-by: psadhukhan, tr
This commit is contained in:
Abhishek Kumar 2024-07-26 06:23:47 +00:00
parent ee839b7f0e
commit 29f0f174a0

@ -610,10 +610,10 @@ class GTKPainter extends SynthPainter {
x + insets.left, y + insets.top, w - insets.left - insets.right,
h - insets.top - insets.bottom);
BufferedImage img = ENGINE.finishPainting();
if(!isHW) {
if (!isHW && img != null) {
int border = img.getRGB(0, h / 2);
if (img != null && border == img.getRGB(w / 2, h / 2)) {
// fix no menu borders in Adwaita theme
if (border == img.getRGB(w / 2, h / 2)) {
// fix no menu borders
Graphics g2 = img.getGraphics();
Color c = new Color(border);
g2.setColor(new Color(Math.max((int) (c.getRed() * 0.8), 0),