Bug #3569
closedTrying to assign categories to a question for assessment fails when not running from within Morpho
0%
Description
When I select a question on a newly parsed exam and then click the "Add Category" button, I get the following stack strace:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at edu.ucsb.nceas.morpho.first.plugins.wizard.EdMLWizardContainerFrame.getDialogParent(EdMLWizardContainerFrame.java:998)
at edu.ucsb.nceas.morpho.first.plugins.wizard.pages.KeywordsPage.<init>(KeywordsPage.java:70)
at edu.ucsb.nceas.morpho.first.plugins.wizard.EdMLWizardPageLibrary.getPage(EdMLWizardPageLibrary.java:112)
at edu.msu.first.parser.gui.actions.AddCategoryAction.actionPerformed(AddCategoryAction.java:60)
It appears that the problem is that UIController.getInstance() (called from EdMLWizardContainerFrame.getDialogParent) returns null outside the context of Morpho.
I propose that if UIController.getInstance() returns null that we use MainWindow.getInstance() as the dialog parent here.
Updated by ben leinfelder about 16 years ago
moving the call to getDialogParent() into a try/catch block.
since we don't plan on this being run outside of Morpho, we'll just ignore the fact that it is being done - the parent can be null with [hopefully] little side effect.