todirbg / kln90b

kln90b gps for x-plane 11
6 stars 2 forks source link

Plugin crashes if `avionics_power` dataref does not exist #5

Closed JDeeth closed 6 months ago

JDeeth commented 6 months ago

I'd set KLN90_panel.lua to use a custom plugin-provided dataref for avionics_power. If the dataref is unavailable e.g. because that plugin hasn't loaded, the KLN90B plugin crashes and you get a SASL error in a popup.

Small potatoes because the solution is "don't configure the GPS to use a non-existent dataref as the power source" but it may be more graceful if under the circumstances, the reason could be logged and the GPS itself just stays powered off?

todirbg commented 6 months ago

That is strange. I think all datarefs in sasl are deferred by default so a non existing dataref should just return 0 not cause a crash. I'll look in to it.

JDeeth commented 6 months ago

Ah - it might be if the dataref is available at first, but is not available when the script is reloaded e.g. because the dataref which provided it is disabled or crashed or otherwise gone. Could close as wontfix if you like - it's probably only gonna affect people who are prodding plugins a lot during dev work!