Map3D should not be silently return 0 if not initialized #6461

at least unit tests are happy
This commit is contained in:
rusefi 2024-05-03 21:39:33 -04:00
parent 8569a39503
commit 06266b709f
1 changed files with 7 additions and 0 deletions

View File

@ -14,6 +14,10 @@
#include "efi_scaled_channel.h"
#include <rusefi/interpolation.h>
#if EFI_UNIT_TEST
#include <stdexcept>
#endif
// popular left edge of CLT-based correction curves
#define CLT_CURVE_RANGE_FROM -40
@ -42,6 +46,9 @@ public:
// RPM is usually X/Column
float getValue(float xColumn, float yRow) const final {
if (!m_values) {
#if EFI_UNIT_TEST
throw std::runtime_error("Access to uninitialized table");
#endif
// not initialized, return 0
return 0;
}