mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 22:56:28 +00:00
FIX: possible NPE in DeleteUnloadedForeignKeys.deleteCascade and in initPostTarget (#1601)
This commit is contained in:
1 parent
50de32af29
commit
b18bc82b8a
3 files changed
+21
-9
No files matched your search
@@ -84,15 +84,17 @@ class DeleteUnloadedForeignKeys {
|
||||
*/
|
||||
void deleteCascade() {
|
||||
|
||||
for (BeanPropertyAssocOne<?> prop : propList) {
|
||||
Object detailBean = prop.getValue(beanWithForeignKeys);
|
||||
if (beanWithForeignKeys != null) {
|
||||
for (BeanPropertyAssocOne<?> prop : propList) {
|
||||
Object detailBean = prop.getValue(beanWithForeignKeys);
|
||||
|
||||
// if bean exists with a unique id then delete it
|
||||
if (detailBean != null && prop.hasId((EntityBean) detailBean)) {
|
||||
if (deletePermanent) {
|
||||
server.deletePermanent(detailBean, request.getTransaction());
|
||||
} else {
|
||||
server.delete(detailBean, request.getTransaction());
|
||||
// if bean exists with a unique id then delete it
|
||||
if (detailBean != null && prop.hasId((EntityBean) detailBean)) {
|
||||
if (deletePermanent) {
|
||||
server.deletePermanent(detailBean, request.getTransaction());
|
||||
} else {
|
||||
server.delete(detailBean, request.getTransaction());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user