-
Notifications
You must be signed in to change notification settings - Fork 2
fix(audit): allow nullable sponsor in SummitSponsorExtraQuestionType::getSponsor #531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b430061
a8e3824
eb2f888
5b4b960
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,7 @@ class SponsorStatistics extends SilverstripeBaseModel | |
| use One2ManyPropertyTrait; | ||
|
|
||
| /** | ||
| * @var Sponsor | ||
| * @var Sponsor|null | ||
| */ | ||
| #[ORM\JoinColumn(name: 'SponsorID', referencedColumnName: 'ID', onDelete: 'CASCADE')] | ||
| #[ORM\OneToOne(targetEntity: Sponsor::class, inversedBy: 'sponsorservices_statistics', fetch: 'EXTRA_LAZY')] | ||
|
|
@@ -66,7 +66,7 @@ public function __construct() | |
| $this->documentsQty = 0; | ||
| } | ||
|
|
||
| public function getSponsor(): Sponsor | ||
| public function getSponsor(): ?Sponsor | ||
| { | ||
| return $this->sponsor; | ||
| } | ||
|
Comment on lines
+69
to
72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Inspect known call sites from current context.
fd -i 'SponsorUserInfoGrantService.php' app --exec sed -n '220,260p' {}
fd -i 'SponsorBadgeScanSerializer.php' app --exec sed -n '50,95p' {}
# Find direct dereferences after getSponsor() (unsafe with nullable contracts).
rg -nP --type=php '\->getSponsor\(\)\s*->' app
# Find getSponsor() passed as arguments for manual nullable-acceptance checks.
rg -nP --type=php '\->getSponsor\(\)\s*[,\)]' appRepository: OpenStackweb/summit-api Length of output: 5085 Fix unguarded The following locations directly dereference
Add null checks or use 🤖 Prompt for AI Agents |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.