Browse files

Added null check to drop in MoleculesEditor

  • Loading branch information...
1 parent 29c8242 commit 9cdba31db8549622ead2265e86b07c10e1b35a40 Arvid Berg committed Jun 29, 2010
View
1 ...ipse.cdk.jchempaint.view/src/net/bioclipse/cdk/jchempaint/view/AtomContainerTransfer.java
@@ -90,6 +90,7 @@ protected void javaToNative( Object object, TransferData transferData ) {
@Override
protected Object nativeToJava( TransferData transferData ) {
byte[] bytes = (byte[]) super.nativeToJava( transferData );
+ if(bytes==null) return null;
return fromByteArray( bytes );
}
}
View
5 ...bioclipse.cdk.ui.sdfeditor/src/net/bioclipse/cdk/ui/sdfeditor/editor/MoleculesEditor.java
@@ -286,7 +286,10 @@ private void enableDrop() {
new DropTargetAdapter() {
public void drop( DropTargetEvent event ) {
- if(event.data == null) return;
+ if(event.data == null){
+ event.detail = DND.DROP_NONE;
+ return;
+ }
if(localSelTransfer.isSupportedType( event.currentDataType )) {
IStructuredSelection sel = (IStructuredSelection)
localSelTransfer.getSelection();

0 comments on commit 9cdba31

Please sign in to comment.