Skip to content

Commit

Permalink
fix: panic: assignment to entry in nil map
Browse files Browse the repository at this point in the history
  • Loading branch information
cobolbaby committed Dec 30, 2021
1 parent 5872120 commit 03b29db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,15 @@ func main() {
func generateTableJoinRelation(qs *QueryStore, ds *DataSource, driver neo4j.Driver) map[string]*erd.RelationShip {
log.Debugf("generateTableJoinRelation sql: %s", qs.Query)

var m, n map[string]*erd.RelationShip
var m map[string]*erd.RelationShip

if udf, err := IdentifyFuncCall(qs.Query); err == nil {
m, _ = HandleUDF4ERD(ds.DB, udf)
} else {
m, _ = erd.Parse(qs.Query)
}

n := make(map[string]*erd.RelationShip)
for kk, vv := range m {
// 过滤掉临时表
if vv.SColumn == nil || vv.TColumn == nil || vv.SColumn.Schema == "" || vv.TColumn.Schema == "" {
Expand Down

0 comments on commit 03b29db

Please sign in to comment.