Skip to content

Instantly share code, notes, and snippets.

@rwst
Created August 10, 2012 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwst/3315686 to your computer and use it in GitHub Desktop.
Save rwst/3315686 to your computer and use it in GitHub Desktop.
fixes stacktrace with JCP issue #60
diff --git a/src/main/org/openscience/jchempaint/controller/ReactionHub.java b/src/main/org/openscience/jchempaint/controller/ReactionHub.java
index beb8ebe..d973f2e 100644
--- a/src/main/org/openscience/jchempaint/controller/ReactionHub.java
+++ b/src/main/org/openscience/jchempaint/controller/ReactionHub.java
@@ -72,7 +72,7 @@ public class ReactionHub {
chemModel.setReactionSet(reactionSet);
chemModel.getMoleculeSet().removeAtomContainer(oldcontainer);
if(chemModel.getMoleculeSet().getAtomContainerCount()==0)
- chemModel.getMoleculeSet().addAtomContainer(chemModel.getBuilder().newInstance(IAtomContainer.class));
+ chemModel.getMoleculeSet().addAtomContainer(chemModel.getBuilder().newInstance(IMolecule.class));
if(controllerhub.getUndoRedoFactory()!=null && controllerhub.getUndoRedoHandler()!=null){
IUndoRedoable undoredo = controllerhub.getUndoRedoFactory().getMakeReactantOrProductInNewReactionEdit(chemModel, newContainer, oldcontainer, false, "Make Reactant in new Reaction");
controllerhub.getUndoRedoHandler().postEdit(undoredo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment