mrlegowatch / GarageStorageSwift

A Swift implementation of GarageStorage. Provides a convenient way to store any kind of data in a repository backed by Core Data.
MIT License
8 stars 1 forks source link

Generalize the gs_data nil check for other calls that can handle throwing #32

Closed mrlegowatch closed 2 months ago

mrlegowatch commented 2 months ago

A nil check was added for retrieving a Core Data object when gs_data is unexpectedly nil, which is possible to happen if somehow the assignment is interrupted but the save goes through anyway, for example a due to a data race in client code. The nil check was confirmed to resolve (or work around) a specific client's data race, so it can be now safely extended to other callers of gs_data.