Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent cloning non-existing objects #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/CommunityCommons/javasource/communitycommons/ORM.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ private static void duplicate(IContext ctx, IMendixObject src, IMendixObject tar
List<IMendixIdentifier> res = new ArrayList<IMendixIdentifier>();
for (IMendixIdentifier item : rs.getValue(ctx)) {
IMendixObject o = Core.retrieveId(ctx, item);
IMendixIdentifier refObj = getCloneOfObject(ctx, o, toskip, tokeep, revAssoc, skipEntities, skipModules, mappedObjects);
res.add(refObj);
// Do not try to clone a non-existing object
if (null != o) {
IMendixIdentifier refObj = getCloneOfObject(ctx, o, toskip, tokeep, revAssoc, skipEntities, skipModules, mappedObjects);
res.add(refObj);
}
}
tar.setValue(ctx, key, res);
} else if (m instanceof MendixAutoNumber) //skip autonumbers! Ticket 14893
Expand Down