Commit 1e2fe2a0 authored by Simon Barner's avatar Simon Barner
Browse files

Fix NPE when copying top-level elements from one project to another.

refs 2347
parent 09951c1f
ActionUtils.java b41f60eef8464224b98b0b62fd30221be4686a4d GREEN
ConstraintsUIUtils.java 40a2893754ec8923a84889c7f5ae33873ccc3332 GREEN
CopyPasteUtils.java 0c15b009bc7731dbd34349480d6bfa14af29e1b6 GREEN
CopyPasteUtils.java 6c6c090f3c61854ce1a2331a710e23a18eaccd37 YELLOW
DataBindingUtils.java 2d27702d42ae7d89922af314be20e18e771d107f GREEN
DragAndDropUtils.java fc8b7667405f329a05ce60428161e4d096d6547c GREEN
EObjectSelectionUtils.java 8e74691388cc7e19af23e6eae03460184cf179e5 GREEN
......
......@@ -237,14 +237,15 @@ public class CopyPasteUtils {
/**
* Creates a @{link {@link EList} of the eContents of the current {@link EObject} and the
* eConents of its container.
* eContents of its container.
*/
private static EList<EObject> getContentsAtTwoLevels(EObject target) {
EList<EObject> containtsOfContainer = target.eContainer().eContents();
EList<EObject> contents = target.eContents();
EList<EObject> allContents = new BasicEList<EObject>();
allContents.addAll(containtsOfContainer);
allContents.addAll(contents);
if(target.eContainer() != null) {
allContents.addAll(target.eContainer().eContents());
}
allContents.addAll(target.eContents());
return allContents;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment