nasa / CCDD

CFS Command and Data Dictionary Tool (CCDDT)
81 stars 31 forks source link

Cannot export to XTCE in 2.0.25 #89

Closed merose closed 3 years ago

merose commented 3 years ago

When trying to export project data to XTCE using release 2.0.25, I get this exception:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at CCDD.CcddTableManagerDialog$1.complete(CcddTableManagerDialog.java:597)
    at CCDD.CcddBackgroundCommand$1.done(CcddBackgroundCommand.java:174)
    at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
    at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:832)
    at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
    at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingWorker.java:842)
    at javax.swing.Timer.fireActionPerformed(Timer.java:313)
    at javax.swing.Timer$DoPostEvent.run(Timer.java:245)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

The exception occurs when accessing exportEntireDatabaseCb on line 597:

if (exportEntireDatabaseCb.isSelected()) {

If you search through the code you will notice that that variable is only initialized if the dialog type is CSV or JSON:

        /* Check if exporting in CSV or JSON format */
        if (dialogType == ManagerDialogType.EXPORT_CSV || dialogType == ManagerDialogType.EXPORT_JSON) {
            ... lines omitted ...
            exportEntireDatabaseCb = new JCheckBox("Export full database");
            ... lines omitted ...
        }

Suggest either always initializing this variable, perhaps in the declaration, but only including it in the panel if it is needed, maybe setting it to "checked" always if XTCE, or always add it to the panel, but pre-check it and disable it if XTCE.

bawillisJSC commented 3 years ago

Just pushed an update to 2.0.25. Includes a fix for this issue.