Skip to content

Conversation

@MohammadAdib
Copy link

@MohammadAdib MohammadAdib commented Dec 8, 2025

Summary

  • Fixes null reference exception in TilePrefetcherMenu.cs when Overlay is null
  • Adds null check before accessing Overlay.Polygons to prevent crash during tile prefetch operations

Test plan

  • Open Mission Planner and navigate to map view
  • Use the tile prefetch feature
  • Verify no null reference exception occurs

- Update IsVehicleConnected to check for valid lat/lng coordinates
- Add location validation to FlightData before updating Map3D
- Prevents 3D map from centering on 0,0 when connected but no GPS fix
Brings in:
- Tile loading algorithm improvements with weighted distance/zoom scoring
- 500MB tile cache
- Valid GPS location check (not 0,0) before tracking vehicle
- Disconnected mode camera and tile loading improvements
- Motor test smart assign swap feature

Keeps STLModelLoader with default STL selection based on MAV_TYPE
- Enable smooth fractional zoom scrolling for all maps
- Use camera position for 3D map tile generation
- Set ScaleMode to Fractional for smoother zooming
Comment on lines -22 to -23
numericUpDownMinZoom.Minimum = numericUpDownMaxZoom.Minimum = trackBarMinZoom.Minimum = trackBarMaxZoom.Minimum = min;
numericUpDownMinZoom.Maximum = numericUpDownMaxZoom.Maximum = trackBarMinZoom.Maximum = trackBarMaxZoom.Maximum = max;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this change. I don't think moving these two lines down has anything to do with it. This PR should just be adding an isInitialized flag.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - hold my beer

@robertlong13
Copy link
Collaborator

Also fix up the commit message

@MohammadAdib MohammadAdib force-pushed the fix-tileprefetcher-null-reference branch from 46eef54 to ab67395 Compare December 8, 2025 21:50
@MohammadAdib MohammadAdib deleted the fix-tileprefetcher-null-reference branch December 8, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants