Potential bug in nrf_cli.c (SDK 15.3.0)

I am trying to light-switch test different features in my app to see if I can save some memory, and I found that the examples\peripheral\cli example won't compile if I turn off NRF_CLI_HISTORY_ENABLED

To get it to work correctly (I think) I had to add the preprocessor gating on the call to history_mode_exit() in file components\libraries\cli\nrf_cli.c, around line 1994:

#if NRF_MODULE_ENABLED(NRF_CLI_HISTORY)
history_mode_exit(p_cli);
#endif

Does this look like the right way to solve the issue?