mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Fix printing when one obj is nil
This commit is contained in:
@@ -1949,7 +1949,15 @@ func getObjectBeingUsed(tw *trap.Writer, ident *ast.Ident) types.Object {
|
||||
obj1 := getObjectBeingUsed1(tw, ident)
|
||||
obj2 := getObjectBeingUsed2(tw, ident)
|
||||
if obj1 != obj2 {
|
||||
log.Fatalf("different results!\nobj1 = %s\nobj2=%s\n", obj1.String(), obj2.String())
|
||||
string1 := "nil"
|
||||
if obj1 != nil {
|
||||
string1 = obj1.String()
|
||||
}
|
||||
string2 := "nil"
|
||||
if obj1 != nil {
|
||||
string2 = obj1.String()
|
||||
}
|
||||
log.Fatalf("different results!\nobj1 = %s\nobj2 = %s\n", string1, string2)
|
||||
}
|
||||
return obj2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user