Fix NPE in ScreenShotPlugin
Fix NPE that happens when titlebar is not present (not using the custom window decorations) and plugin is trying to remove the screenshot button from titlebar. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -169,10 +169,13 @@ public class ScreenshotPlugin extends Plugin
|
||||
SwingUtilities.invokeLater(() ->
|
||||
{
|
||||
JComponent titleBar = SubstanceCoreUtilities.getTitlePaneComponent(clientUi);
|
||||
titleBar.remove(titleBarButton);
|
||||
|
||||
clientUi.revalidate();
|
||||
clientUi.repaint();
|
||||
if (titleBar != null)
|
||||
{
|
||||
titleBar.remove(titleBarButton);
|
||||
clientUi.revalidate();
|
||||
clientUi.repaint();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user