The code in FunctionImplementationRegistry.functionReplacement() will produce an NPE if ever it is called:
If an option manager is provided, then get the specified option. The option manager will contain a value for that option only if the user has explicitly set that option. Suppose the user had not set the option. Then the return from getOption() will be null.
The next thing we do is assume that the option exists and is a boolean by dereferencing the option. This will trigger an NPE. This NPE was seen in detail-level unit tests.
The proper way to handle such options is to use an option validator. Strangely, one actually exists in ExecConstants: