There is domain object:
class Book {
List
i think the problem can depend on the cascade delete behaviour you set on the class. First of all, after calling
subject.removeFromPictures(pic)
subject.save()
You have to call.
pic.delete()
But if the problem persist, you can use GORM events so in your class you can add:
class Book {
...
...
def beforeUpdate(){
checkNulls()
}
def beforeValidate(){
checkNulls()
}
def checkNulls(){
pictures?.removeAll(null)
}
Ref: GORM Events