if Null
Sets a handler to be invoked when the configuration field is null or missing.
This method allows specifying a custom implementation of the ErrorHandlerWith interface that defines the behavior when a field is found to be null during validation or loading.
The handler can log warnings, throw exceptions, or provide fallback values.
Example:
field(AppConfig::apiKey).ifNull(LogWarningHandler::class)Content copied to clipboard
Return
this FieldConfigScope for method chaining
Parameters
handler
the class of the custom error handler implementing ErrorHandlerWith