ICEpdf
  1. ICEpdf
  2. PDF-253

SwingController thowing null pointer exception on print.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.3
    • Fix Version/s: 4.1.4
    • Component/s: Viewer RI
    • Labels:
      None
    • Environment:
      any
    • Assignee Priority:
      P1
    • Workaround Description:
      Hide
      Create a new instance of the properties manager.
      PropertiesManager properties =
                       new PropertiesManager(System.getProperties(),
                               ResourceBundle.getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));
       SwingController controller = new SwingController();
       SwingViewBuilder factory = new SwingViewBuilder(controller, properties);
      Show
      Create a new instance of the properties manager. PropertiesManager properties =                  new PropertiesManager(System.getProperties(),                          ResourceBundle.getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));  SwingController controller = new SwingController();  SwingViewBuilder factory = new SwingViewBuilder(controller, properties);

      Description

      The Swing controller when used as a component throws this exception.

      Exception in thread "Thread-5" java.lang.NullPointerException
      at org.icepdf.ri.common.SwingController.savePrinterProperties(SwingController.java:2653)
      at org.icepdf.ri.common.SwingController.initialisePrinting(SwingController.java:2599)
      at org.icepdf.ri.common.SwingController.access$400(SwingController.java:103)
      at org.icepdf.ri.common.SwingController$3.run(SwingController.java:2549)
      at java.lang.Thread.run(Unknown Source)

      There is a pretty simple work around but I would rather that the defautl SwingViewBuilder would create a new isntance of the properites manager or alternatively do a check for the null manager.

        Activity

        Hide
        Patrick Corless added a comment -

        The work around is sufficient for most people but I also added a null pointer check encase someone doesn't want to use the property Manger with the component.

        Show
        Patrick Corless added a comment - The work around is sufficient for most people but I also added a null pointer check encase someone doesn't want to use the property Manger with the component.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Patrick Corless
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: