Prevent to handle $output var with invalid value.
If $output is empty or haven't version string, will return empty version.
I identified maybe a specific scenario with exec command when the $ouput get a delay to get the output of command and in this case the $output will be empty.
I thought about putting a delay like the follow code to prevent this problem. But, I did this with success, this looked like a more strange workaround to solve the problem. Because of this, I did the more simple, only checking if $output have the expected value.
Maybe, the suggested code here can solve definitively the problem. Waiting for opinions from code review.
Still in time, the scenario in that I found this edge case was in a setup flow when I download the JSignPdf and with other process I do a loop waiting for finish download to check the downloaded version.
Prevent to handle
$output
var with invalid value. If$output
is empty or haven'tversion
string, will return empty version.I identified maybe a specific scenario with exec command when the
$ouput
get a delay to get the output of command and in this case the$output
will be empty.I thought about putting a delay like the follow code to prevent this problem. But, I did this with success, this looked like a more strange workaround to solve the problem. Because of this, I did the more simple, only checking if
$output
have the expected value.Maybe, the suggested code here can solve definitively the problem. Waiting for opinions from code review.
Still in time, the scenario in that I found this edge case was in a setup flow when I download the JSignPdf and with other process I do a loop waiting for finish download to check the downloaded version.