Viewing Issue Advanced Details

ID 0003892 Category [DMDirc] Core Severity minor
Reproducibility always Date Submitted 2010-03-10 10:35 Last Update 2010-03-10 23:57
Reporter Error Reporter Assigned To Greboid View Status public
Priority normal Status resolved Resolution fixed
Platform Fixed in Version Target Version 0.6.4
Product Version Product Build 0.6.3
Summary 0003892: Unable to execute thread. — ui.CoreUIUtils.centreWindow(CoreUIUtils.java:49)
Description
java.lang.NullPointerException
com.dmdirc.ui.CoreUIUtils.centreWindow(CoreUIUtils.java:49)
com.dmdirc.addons.ui_swing.MainFrame.<init>(MainFrame.java:120)
com.dmdirc.addons.ui_swing.SwingController$23.run(SwingController.java:648)
java.awt.event.InvocationEvent.dispatch(Unknown Source)
java.awt.EventQueue.dispatchEvent(Unknown Source)
com.dmdirc.addons.ui_swing.DMDircEventQueue.dispatchEvent(DMDircEventQueue.java:79)
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.run(Unknown Source)

Which caused: java.lang.reflect.InvocationTargetException
java.awt.EventQueue.invokeAndWait(Unknown Source)
javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
com.dmdirc.addons.ui_swing.UIUtilities.invokeAndWait(UIUtilities.java:179)
com.dmdirc.addons.ui_swing.SwingController.onLoad(SwingController.java:642)
com.dmdirc.plugins.PluginInfo.loadClass(PluginInfo.java:962)
com.dmdirc.plugins.PluginInfo.loadPlugin(PluginInfo.java:871)
com.dmdirc.plugins.PluginInfo.activateServices(PluginInfo.java:753)
com.dmdirc.plugins.Service.activate(Service.java:143)
com.dmdirc.Main.loadUI(Main.java:300)
com.dmdirc.Main.init(Main.java:130)
com.dmdirc.Main.main(Main.java:86)
Needs unit test no
Upstream Bug URL

Relationships

has duplicate 0003893closedMD87 java.lang.NullPointerException — ui.CoreUIUtils.centreWindow(CoreUIUtils.java:49) 

Notes

A patchset (1) related to this change has been added to gerrit by Greboid

Fixes issue 3892

Add some null checks for when the user doesn't have a pointer of a screen
and other sensible likely situations like that

Change-Id: Id3e034fd462f4ed26369d17f04941005afef1b8a
authorGreboid <greg@dmdirc.com>2010-03-10 22:21:52 (GMT)
committer Chris Smith <chris@dmdirc.com>2010-03-10 23:56:30 (GMT)
commit56c35be7b9bbe3b75bc00f3528fea2bc86183cee (patch) (side-by-side diff)
Add some null checks for when the user doesn't have a pointer of a screen and other sensible likely situations like that Change-Id: Id3e034fd462f4ed26369d17f04941005afef1b8a Reviewed-on: http://gerrit.dmdirc.com/1007 Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com> Reviewed-by: Chris Smith <chris@dmdirc.com>
-rw-r--r--src/com/dmdirc/ui/CoreUIUtils.java9
1 files changed, 9 insertions, 0 deletions
Click to Expand/Collapse
diff src/com/dmdirc/ui/CoreUIUtils.java
@@ -45,11 +45,20 @@ public class CoreUIUtils {
public static void centreWindow(final Window window) {
// Get the Location of the mouse pointer
final PointerInfo myPointerInfo = MouseInfo.getPointerInfo();
+ if (myPointerInfo == null) {
+ return;
+ }
// Get the Device (screen) the mouse pointer is on
final GraphicsDevice myDevice = myPointerInfo.getDevice();
+ if (myDevice == null) {
+ return;
+ }
// Get the configuration for the device
final GraphicsConfiguration myGraphicsConfig =
myDevice.getDefaultConfiguration();
+ if (myGraphicsConfig == null) {
+ return;
+ }
// Get the bounds of the device
final Rectangle gcBounds = myGraphicsConfig.getBounds();
// Calculate the centre of the screen

Issue History

Date Modified Username Field Change
2010-03-10 10:35 Error Reporter New Issue
2010-03-10 10:35 Error Reporter Status new => assigned
2010-03-10 10:35 Error Reporter Assigned To => MD87
2010-03-10 12:33 MD87 Relationship added has duplicate 0003893
2010-03-10 12:33 MD87 View Status private => public
2010-03-10 12:33 MD87 Assigned To MD87 => Greboid
2010-03-10 22:21 Version Control Checkin
2010-03-10 22:21 Version Control Note Added: 0010298
2010-03-10 22:21 Version Control Status assigned => fix pending
2010-03-10 23:57 Greboid Checkin
2010-03-10 23:57 Greboid Note Added: 0010300
2010-03-10 23:57 Greboid Status fix pending => resolved
2010-03-10 23:57 Greboid Resolution open => fixed