commit f5f42528afe1b7bf8ac4c8cbc4e64f322474a26a
parent ff6b19578e5a8225c2856be146c042cc3bdec4e7
Author: William Casarin <jb55@jb55.com>
Date: Mon, 29 Jan 2024 12:50:12 -0800
txn: fix potential crash from transaction in view closure
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/damus/Views/SideMenuView.swift b/damus/Views/SideMenuView.swift
@@ -89,13 +89,14 @@ struct SideMenuView: View {
}
var TopProfile: some View {
- let profile_txn = damus_state.ndb.lookup_profile(damus_state.pubkey, txn_name: "top_profile")
- let profile = profile_txn?.unsafeUnownedValue?.profile
return VStack(alignment: .leading, spacing: verticalSpacing) {
HStack {
ProfilePicView(pubkey: damus_state.pubkey, size: 60, highlight: .none, profiles: damus_state.profiles, disable_animation: damus_state.settings.disable_animation)
VStack(alignment: .leading) {
+ let profile_txn = damus_state.ndb.lookup_profile(damus_state.pubkey, txn_name: "top_profile")
+ let profile = profile_txn?.nsafeUnownedValue?.profile
+
if let display_name = profile?.display_name {
Text(display_name)
.foregroundColor(textColor())