Details
-
Bug
-
Status: Resolved
-
Resolution: Incomplete
-
1.7
-
None
-
None
-
Operating System: Windows XP
Platform: PC
Description
Starting at line 299 in org.apache.batik.apps.svgbrowser.Main() is the following code:
JSVGViewerFrame relativeTo =
viewerFrames.isEmpty()
? null
: (JSVGViewerFrame) viewerFrames.get(0);
AboutDialog dlg = new AboutDialog(relativeTo);
// Work around pack() bug on some platforms
dlg.setSize(dlg.getPreferredSize());
dlg.setLocationRelativeTo(relativeTo);
relativeTo may be set to null. This will later get passed do setLocationRelativeTo(). In AboutDlg's overridden version of this method the parameter is unconditionally dereferenced, which could cause a null pointer exception.
AboutDlg.setLocationRelativeTo() should probably be changed to accept a null value to maintain the contract set by AboutDlg's parent JWindow.
This was detected by FindBugs.