-
-
Notifications
You must be signed in to change notification settings - Fork 128
Open
Description
Problem
When validating an invalid certificate using checkCertificate, a runtime error can occur:
This happens because the implementation tries to call .toString() on stderr, which can be undefined in some cases.
Root Cause
In the current implementation, the code attempts to inspect stderr before handling the error object.
If stderr is undefined, this leads to a TypeError when calling .toString().
Fix
This PR changes the order of error handling to check the error object before accessing stderr.
This ensures that if an error is thrown, it is handled properly and avoids accessing potentially undefined variables.
Question
Is it acceptable to change the order of error handling in this way?
It seems to be a safe and necessary adjustment to prevent unexpected runtime errors.
Metadata
Metadata
Assignees
Labels
No labels
