Commit 45f449f
committed
AP_Scripting: fix OSD example availability check
The OSD binding exists when OSD_ENABLED is true, but the underlying
backend may be nullptr at runtime (e.g., when SITL is not built with
SFML support). The simple "if not osd" check only verifies the binding
exists, not whether the backend is valid.
Add a pcall-based check that tests if a method call succeeds, which
properly detects when the backend is unavailable.1 parent 3dea8a0 commit 45f449f
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
141 | 149 | | |
142 | 150 | | |
143 | 151 | | |
| |||
0 commit comments