-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
XFA - Prevent breaking errors in Binder
, when searchNode
doesn't return data (issue 13756)
#13761
Conversation
…return data (issue 13756) As can be seen in the code (see below), the `searchNode` helper function will return `null` in some cases and all of its call-sites should protect against that before attempting to access the returned data. While only one of these changes were necessary to fix the breaking errors in issue 13756, in order to prevent future bugs I've added similar defensive code throughout this file. - https://github.com/mozilla/pdf.js/blob/07955fa1d31df62fd668a15f58cd40b29a82bd63/src/core/xfa/som.js#L169 - https://github.com/mozilla/pdf.js/blob/07955fa1d31df62fd668a15f58cd40b29a82bd63/src/core/xfa/som.js#L239 - https://github.com/mozilla/pdf.js/blob/07955fa1d31df62fd668a15f58cd40b29a82bd63/src/core/xfa/som.js#L254
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks for doing that.
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/543dc83afa2916b/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/b7d0a36805c437f/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/543dc83afa2916b/output.txt Total script time: 32.55 mins
Image differences available at: http://54.67.70.0:8877/543dc83afa2916b/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://3.101.106.178:8877/b7d0a36805c437f/output.txt Total script time: 37.91 mins
Image differences available at: http://3.101.106.178:8877/b7d0a36805c437f/reftest-analyzer.html#web=eq.log |
/botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/ce1b51af21ad9ae/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 1 Live output at: http://3.101.106.178:8877/b7f072715331748/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/ce1b51af21ad9ae/output.txt Total script time: 29.33 mins
|
From: Bot.io (Windows)SuccessFull output at http://3.101.106.178:8877/b7f072715331748/output.txt Total script time: 35.46 mins
|
As can be seen in the code (see below), the
searchNode
helper function will returnnull
in some cases and all of its call-sites should protect against that before attempting to access the returned data.While only one of these changes were necessary to fix the breaking errors in issue #13756, in order to prevent future bugs I've added similar defensive code throughout this file.
pdf.js/src/core/xfa/som.js
Line 169 in 07955fa
pdf.js/src/core/xfa/som.js
Line 239 in 07955fa
pdf.js/src/core/xfa/som.js
Line 254 in 07955fa