File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
swift/example_code/apple/Buckets/Buckets Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import AWSSDKIdentity
1919/// store any PII securely, such as by using the Keychain!
2020///
2121/// There are many useful packages available for this purpose that
22- /// you can find using the [Swift Package
22+ /// you can find using the [Swift Package
2323/// Index](https://swiftpackageindex.com/).
2424@MainActor
2525class ViewModel : ObservableObject {
@@ -193,6 +193,10 @@ class ViewModel: ObservableObject {
193193
194194 // Save the user's data securely to local storage so it's available
195195 // in the future.
196+ //
197+ // IMPORTANT: Any potential Personally Identifiable Information _must_
198+ // be saved securely, such as by using the Keychain or an appropriate
199+ // encrypting technique.
196200
197201 saveUserData ( )
198202 }
@@ -234,6 +238,11 @@ class ViewModel: ObservableObject {
234238 /// The bucket names are stored in the view model's `bucketList`
235239 /// property.
236240 func getBucketList( ) async throws {
241+ // If there's no identity resolver yet, return without doing anything.
242+ guard let identityResolver = identityResolver else {
243+ return
244+ }
245+
237246 // Create an Amazon S3 client configuration that uses the
238247 // credential identity resolver created from the JWT token
239248 // returned by Sign In With Apple.
You can’t perform that action at this time.
0 commit comments