Skip to content

Commit

Permalink
Improve the check for empty ID
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhiguo committed Feb 28, 2025
1 parent 70145ed commit 786caa6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected void startSync() throws Exception {
spaceListSyncer = createSpaceListSyncer();
Location location = application.getLocation();
String laneSpaceId = location == null ? null : location.getLaneSpaceId();
if (laneSpaceId == null) {
if (laneSpaceId == null || laneSpaceId.isEmpty()) {
syncSpaceList();
} else {
syncSpace(laneSpaceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ protected void startSync() throws Exception {
spaceListSubscription = new Subscription<>(getName(), createSpaceListKey(), this::onSpaceListResponse);
spaceListSyncer = createSpaceListSyncer();
Location location = application.getLocation();
String laneSpaceId = location == null ? null : location.getLiveSpaceId();
if (laneSpaceId == null) {
String liveSpaceId = location == null ? null : location.getLiveSpaceId();
if (liveSpaceId == null || liveSpaceId.isEmpty()) {
syncSpaceList();
} else {
syncSpace(laneSpaceId);
syncSpace(liveSpaceId);
}
}

Expand Down Expand Up @@ -127,7 +127,7 @@ protected void onSpaceListResponse(SyncResponse<List<ApiSpace>> response) {
* Handles the response from the sync operation for a LiveSpace object.
*
* @param response The SyncResponse object containing the response from the sync operation.
* @param spaceId The space id.
* @param spaceId The space id.
*/
protected void onSpaceResponse(SyncResponse<LiveSpace> response, String spaceId) {
switch (response.getStatus()) {
Expand Down Expand Up @@ -168,7 +168,7 @@ protected void updateSpaceList(List<ApiSpace> apiSpaces) {
* Updates the specified LiveSpace object.
*
* @param spaceId The space id.
* @param space The LiveSpace object to update.
* @param space The LiveSpace object to update.
*/
protected void updateSpace(String spaceId, LiveSpace space) {
if (space == null) {
Expand Down

0 comments on commit 786caa6

Please sign in to comment.