Skip to content

Commit 17d1d77

Browse files
author
Joseph Kaile
committed
ensure that connection is able to connect when resuming
1 parent 0880d17 commit 17d1d77

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

Source/CesiumEditor/Private/CesiumIonSession.cpp

+12-11
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,20 @@ void CesiumIonSession::resume() {
160160
std::shared_ptr<CesiumIonSession> thiz = this->shared_from_this();
161161

162162
// Verify that the connection actually works.
163-
this->_connection.value()
164-
.me()
165-
.thenInMainThread([thiz](Response<Profile>&& response) {
166-
if (!response.value.has_value()) {
167-
thiz->_connection.reset();
163+
bool connected = false;
164+
this->_connection.value().me().thenInMainThread(
165+
[thiz, &connected](Response<Profile>&& response) {
166+
if (response.value.has_value()) {
167+
connected = true;
168+
thiz->_isResuming = false;
169+
thiz->ConnectionUpdated.Broadcast();
168170
}
169-
thiz->_isResuming = false;
170-
thiz->ConnectionUpdated.Broadcast();
171-
})
172-
.catchInMainThread([thiz](std::exception&& e) {
173-
thiz->_isResuming = false;
174-
thiz->_connection.reset();
175171
});
172+
if (!connected) {
173+
thiz->_isResuming = false;
174+
thiz->_connection.reset();
175+
thiz->ConnectionUpdated.Broadcast();
176+
}
176177
}
177178

178179
void CesiumIonSession::disconnect() {

extern/cesium-native

0 commit comments

Comments
 (0)