From cd606bcdb36ea9e8187ed1295a61e255ab6c0dfd Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 3 Sep 2024 17:06:31 +1000 Subject: [PATCH] Reapply "Handle possibility of a null token." This reverts commit cefb04695cba6828c87f3766e4dcc401cd9e0d14. --- CHANGES.md | 1 + Editor/SelectIonTokenWindow.cs | 2 +- Runtime/CesiumIonServer.cs | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e44e9d7f..fb874fdc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ ##### Fixes :wrench: +- Fixed a bug that prevented using the Token panel with a new Cesium ion Server that had never had its token set before. - Fixed a bug that could cause a crash in `CesiumIonSession` when the object was garbage collected or the AppDomain was unloaded while network requests were in progress. - Fixed a bug that could cause `CesiumFlyToController` to unexpectedly interrupt a flight. - glTF `doubleSided` materials are now supported. Previously, models using this property would appear inside-out. diff --git a/Editor/SelectIonTokenWindow.cs b/Editor/SelectIonTokenWindow.cs index 30f20348..eed6d132 100644 --- a/Editor/SelectIonTokenWindow.cs +++ b/Editor/SelectIonTokenWindow.cs @@ -110,7 +110,7 @@ private void OnGUI() // The source will be set to "UseExisting" later by RefreshTokens // if the _specifiedToken is from the currently signed-in ion account. this._source = IonTokenSource.Specify; - if (this._specifiedToken.Length == 0 && session.IsConnected()) + if (string.IsNullOrEmpty(this._specifiedToken) && session.IsConnected()) { this._source = IonTokenSource.Create; } diff --git a/Runtime/CesiumIonServer.cs b/Runtime/CesiumIonServer.cs index 47697819..b86ba4c0 100644 --- a/Runtime/CesiumIonServer.cs +++ b/Runtime/CesiumIonServer.cs @@ -38,13 +38,13 @@ public class CesiumIonServer : ScriptableObject /// found by searching the logged-in Cesium ion account for the /// DefaultIonAccessToken. /// - public string defaultIonAccessTokenId; + public string defaultIonAccessTokenId = ""; /// /// The default token used to access Cesium ion assets at runtime. This token /// is embedded in packaged games for use at runtime. /// - public string defaultIonAccessToken; + public string defaultIonAccessToken = ""; // The server URL for which we are currently attempting to deduce an API URL. When this property // is null, we're not currently loading a config.json in order to deduce an API URL for the server.