Skip to content

Commit 4dba2d4

Browse files
committed
Add distance negative checking
1 parent 877f0e0 commit 4dba2d4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

db/schema_explorer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ func NewSchemaExplorer(schema *Schema) *SchemaExplorer {
2525

2626
// Explore returns surrounding tables from table
2727
func (e *SchemaExplorer) Explore(tableName string, distance int) []string {
28+
if distance < 0 {
29+
distance = 0
30+
}
31+
2832
foundTableNames := mapset.NewSet()
2933

3034
e.explore(tableName, distance, foundTableNames, 0)

0 commit comments

Comments
 (0)