Add getOptionalEnvVar helper
#3233
+69
−8
Merged
getOptionalEnvVar helper
#3233