Skip to content

Fixed TokenTroubleshooting for CesiumGeoJsonDocumentRasterOverlay#705

Open
gojushin wants to merge 1 commit into
CesiumGS:mainfrom
gojushin:fix-geojsondocumentrasteroverlay-troubleshoot-token
Open

Fixed TokenTroubleshooting for CesiumGeoJsonDocumentRasterOverlay#705
gojushin wants to merge 1 commit into
CesiumGS:mainfrom
gojushin:fix-geojsondocumentrasteroverlay-troubleshoot-token

Conversation

@gojushin

@gojushin gojushin commented Jul 1, 2026

Copy link
Copy Markdown

Description

tldr:

Clicking "Troubleshoot Token" on a CesiumGeoJsonDocumentRasterOverlay Component causes a NullReferenceException, because of a missing Implementation.

non-tldr:

The main root of the issue lies in a missing implementation inside the getServer function of IonTokenTroubleshootingWindowImpl.cpp.

When the CesiumIonAsset used in the window is created, this constructor is called:

public CesiumIonAsset(CesiumGeoJsonDocumentRasterOverlay overlay)
{
    this._type = AssetType.GeoJsonOverlay;
    this._geoJsonOverlay = overlay;
}

Consequently, getServer returns a nullptr in the final else block because both asset.tileset and asset.overlay are never set.
However, the constructor in CesiumIonAsset.cs specifically sets the _geoJsonOverlay variable (which has a public getter), which we can use here.

(This follows the same pattern as _tileset and _overlay)

So. Eventually, the issue can be fixed by adding a check for asset.geoJsonOverlay (and adding it to ConfigureReinteropEditor.cs's ExposeToCPP of course).

Issue number or link

I very briefly mentioned this bug here

Author checklist

  • I have submitted a Contributor License Agreement (only needed once).
  • I have done a full self-review of my code.
  • I have updated CHANGES.md with a short summary of my change (for user-facing changes).
    (However, I wasn't sure where to put it, so I just added it to the latest changes....😅)
  • I have added or updated unit tests to ensure consistent code coverage as necessary.
  • I have updated the documentation as necessary.

Testing plan

In the current version of the plugin clicking "Troubleshoot Token" on a CesiumGeoJsonDocumentRasterOverlay Component causes a NullReferenceException.

After implementing the fix, everything works as expected.

- Fixed a `NullReferenceException` thrown when opening the Cesium ion token troubleshooting window for a `CesiumGeoJsonDocumentRasterOverlay`
- Added a Unit Test to validate CesiumGeoJsonDocumentRasterOverlay.ionServer is no longer null.
- Updated CHANGES.md
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.

1 participant