Skip to content

Commit

Permalink
fix: check nil shard
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-sirotin authored and iurimatias committed Nov 30, 2023
1 parent 258bde4 commit 0ff7c33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app_service/service/shared_urls/dto/url_data.nim
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ proc toJsonNode*(communityUrlDataDto: CommunityUrlDataDto): JsonNode =
jsonObj["membersCount"] = %* communityUrlDataDto.membersCount
jsonObj["color"] = %* communityUrlDataDto.color
jsonObj["communityId"] = %* communityUrlDataDto.communityId
jsonObj["shardCluster"] = %* communityUrlDataDto.shard.cluster
jsonObj["shardIndex"] = %* communityUrlDataDto.shard.index
jsonObj["shardCluster"] = %*(if communityUrlDataDto.shard != nil: communityUrlDataDto.shard.cluster else: -1)
jsonObj["shardIndex"] = %*(if communityUrlDataDto.shard != nil: communityUrlDataDto.shard.index else: -1)
return jsonObj

proc `$`*(communityUrlDataDto: CommunityUrlDataDto): string =
Expand Down
6 changes: 4 additions & 2 deletions ui/imports/shared/popups/ImportCommunityPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ StatusDialog {
if (!linkData) {
return ""
}
d.shardCluster = linkData.shardCluster
d.shardIndex = linkData.shardIndex
if (linkData.shardCluster != undefined && linkData.shardIndex != undefined) {
d.shardCluster = linkData.shardCluster
d.shardIndex = linkData.shardIndex
}
return linkData.communityId
}
if (!Utils.isCommunityPublicKey(inputKey))
Expand Down

0 comments on commit 0ff7c33

Please sign in to comment.