Commit a1bebc5
fix(sdk): newGranter nil check (#2729)
This pull request makes a targeted fix to the error handling logic in
the `newGranter` function within `sdk/tdf.go`. The change ensures that
if an error occurs while creating the granter, the function immediately
returns the error, preventing further operations on a potentially
invalid object.
Error handling improvement:
* Added an early return in the `newGranter` function to immediately
return if `err` is not nil, improving reliability and preventing
assignment to `g.keyInfoFetcher` when an error occurs. (`sdk/tdf.go`,
[sdk/tdf.goR458-R460](diffhunk://#diff-04aae07cffd4333871c74efd45d47c4e6739b11bf4ebd9a9b5e90376cbf46d08R458-R460)
---------
Co-authored-by: David Mihalcik <dmihalcik@virtru.com>1 parent 11e6201 commit a1bebc5
1 file changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
378 | | - | |
379 | | - | |
| 377 | + | |
380 | 378 | | |
381 | 379 | | |
382 | 380 | | |
| |||
448 | 446 | | |
449 | 447 | | |
450 | 448 | | |
451 | | - | |
| 449 | + | |
452 | 450 | | |
| 451 | + | |
453 | 452 | | |
454 | 453 | | |
455 | 454 | | |
456 | 455 | | |
457 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
458 | 460 | | |
459 | | - | |
| 461 | + | |
460 | 462 | | |
461 | 463 | | |
462 | 464 | | |
| |||
0 commit comments