Describe the bug
If XPLMFindDataRef fails it returns NULL, and XPLMGetDataf then returns 0.0 (XPLMDataAccess.h:342-344: "the dataref value or 0.0 if the dataref is NULL or the plugin is disabled"). The eight-value vector is built and sent with no validity check between construction and baton->send (xplane_plugin/src/pilotdatasync-xp11.cpp:423-440), so a failed lookup transmits 0.0. That is indistinguishable from a real zero reading, and downstream an altitude of 0 is labeled TAXI.
Expected behavior
DataRef handles are checked for NULL after lookup, and values from a failed lookup are not transmitted, or are sent as something iMotions and the logger can recognize as missing.
Additional context
The plugin checks std::isnan for display (xplane_plugin/src/pilotdatasync-xp11.cpp:267-271), but a failed read never produces NaN, so that check never triggers. The same gap exists on the button path at :144-150. This appears to be an unfinished part of #63.
Found while writing the setup documentation in #138 / #178.
Describe the bug
If
XPLMFindDataReffails it returns NULL, andXPLMGetDatafthen returns 0.0 (XPLMDataAccess.h:342-344: "the dataref value or 0.0 if the dataref is NULL or the plugin is disabled"). The eight-value vector is built and sent with no validity check between construction andbaton->send(xplane_plugin/src/pilotdatasync-xp11.cpp:423-440), so a failed lookup transmits 0.0. That is indistinguishable from a real zero reading, and downstream an altitude of 0 is labeled TAXI.Expected behavior
DataRef handles are checked for NULL after lookup, and values from a failed lookup are not transmitted, or are sent as something iMotions and the logger can recognize as missing.
Additional context
The plugin checks
std::isnanfor display (xplane_plugin/src/pilotdatasync-xp11.cpp:267-271), but a failed read never produces NaN, so that check never triggers. The same gap exists on the button path at:144-150. This appears to be an unfinished part of #63.Found while writing the setup documentation in #138 / #178.