Skip to content
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

handle corrupt previous answers in decodeAnswers #688

Merged
merged 1 commit into from Mar 9, 2016

Conversation

bldewolf
Copy link
Contributor

@bldewolf bldewolf commented Mar 8, 2016

We got a report that a user was unable to open a problem they had previously
attempted and they were receiving this error instead:

Can't use an undefined value as an ARRAY reference at
/opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 871.

The error refers to decodeAnswers, which is trying to use the result of a
Storable::thaw call without verifying that it succeeded (it returns undef on
some errors).

This change makes decodeAnswers catch those errors.

We got a report that a user was unable to open a problem they had previously
attempted and they were receiving this error instead:

	Can't use an undefined value as an ARRAY reference at
	/opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 871.

The error refers to decodeAnswers, which is trying to use the result of a
Storable::thaw call without verifying that it succeeded (it returns undef on
some errors).

This change makes decodeAnswers catch those errors.
@goehle
Copy link
Member

goehle commented Mar 9, 2016

Thanks for submitting this fix to WeBWorK. I tested this by forcing $array_ref to be undefined. Without the patch there is a fatal error. With the patch the problem loads (without the previous answers.)

As a side note, we generally only accept pull requests into the develop branch. This change is small and so I will merge it directly into master. In the future if you could make your changes on a branch of develop and submit the pull request back into develop it would fit our workflow better.

Thanks again.

goehle added a commit that referenced this pull request Mar 9, 2016
handle corrupt previous answers in decodeAnswers
@goehle goehle merged commit 6ecc4ad into openwebwork:master Mar 9, 2016
@goehle goehle mentioned this pull request Mar 9, 2016
@goehle goehle mentioned this pull request Apr 20, 2016
41 tasks
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.

None yet

2 participants