diff --git a/callbacks/query.go b/callbacks/query.go index 8613e46d..92f711f5 100644 --- a/callbacks/query.go +++ b/callbacks/query.go @@ -206,7 +206,9 @@ func Preload(db *gorm.DB) { } } - preload(db, rels, db.Statement.Preloads[name]) + if db.Error == nil { + preload(db, rels, db.Statement.Preloads[name]) + } } } }