Skip to content

Commit e178c5f

Browse files
committed
Add guard.
#528 (comment)
1 parent 7fd68be commit e178c5f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Shared/Samples/Edit features using feature forms/EditFeaturesUsingFeatureFormsView.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,12 @@ struct EditFeaturesUsingFeatureFormsView: View {
173173

174174
/// Applies the edits made in the feature form to the feature service.
175175
private func applyEdits() async throws {
176+
guard let featureForm else { return }
177+
176178
// Saves the feature form edits to the database.
177-
try await featureForm?.finishEditing()
179+
try await featureForm.finishEditing()
178180

179-
guard let serviceFeatureTable = featureForm?.feature.table as? ServiceFeatureTable else {
181+
guard let serviceFeatureTable = featureForm.feature.table as? ServiceFeatureTable else {
180182
return
181183
}
182184

0 commit comments

Comments
 (0)