Commit 319b33a
committed
Fix potential nil pointer dereference in primary key parsing
Fixed a potential panic in PostgreSQL primary key constraint parsing
by using safe type assertion with the comma-ok idiom instead of an
unsafe type assertion.
Changes:
- Replaced unsafe type assertion with checked type assertion
- Added conditional check before accessing String_.Sval
- Removed FIXME comment as issue is now resolved
This prevents potential runtime panics if key.Node is not actually
a *nodes.Node_String_ type, making the code more robust and defensive.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 92e5a24 commit 319b33a
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
422 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
423 | 424 | | |
424 | 425 | | |
425 | 426 | | |
| |||
0 commit comments