xgotext: catch unknown variable type

This commit is contained in:
Benjamin Böhmke
2020-02-26 21:43:19 +01:00
parent f46758caed
commit df996c3ae1

View File

@@ -193,7 +193,8 @@ func (g *GoFile) inspectCallExpr(n *ast.CallExpr) {
} else { } else {
// validate type of object // validate type of object
if !g.checkType(g.getType(e).Type()) { t := g.getType(e)
if t == nil || !g.checkType(t.Type()) {
return return
} }
} }
@@ -201,7 +202,8 @@ func (g *GoFile) inspectCallExpr(n *ast.CallExpr) {
// call to attribute // call to attribute
case *ast.SelectorExpr: case *ast.SelectorExpr:
// validate type of object // validate type of object
if !g.checkType(g.getType(e.Sel).Type()) { t := g.getType(e.Sel)
if t == nil || !g.checkType(t.Type()) {
return return
} }