Skip to content

Fix make sure key is defined before comparing it. - #3161

Merged
Alex-Jordan merged 1 commit into
openwebwork:developfrom
somiaj:more-achievement-fixes
Aug 20, 2026
Merged

Fix make sure key is defined before comparing it.#3161
Alex-Jordan merged 1 commit into
openwebwork:developfrom
somiaj:more-achievement-fixes

Conversation

@somiaj

@somiaj somiaj commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Make sure $localData->{set_id} is defined before comparing it in a ne comparison in still_no_right achievement.

Found another achievement that compared a value that could be undefined.

Make sure `$localData->{set_id}` is defined before comparing
it in a `ne` comparision in still_no_right achievement.
@somiaj
somiaj force-pushed the more-achievement-fixes branch from 4d74a41 to 22e8209 Compare August 20, 2026 22:29

# Initialize $localData.
$localData->{incorrect_streak} //= 0;
$localData->{set_id} //= '';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also change line 18 below to
if ($problem->set_id ne ($localData->{set_id} // '').

But this works too. Either way is fine. Just noting.

@Alex-Jordan
Alex-Jordan merged commit 64018aa into openwebwork:develop Aug 20, 2026
2 checks passed
@somiaj
somiaj deleted the more-achievement-fixes branch August 20, 2026 23:14
Alex-Jordan added a commit that referenced this pull request Aug 20, 2026
Fix make sure key is defined before comparing it. (Hotfix of #3161)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants