Skip to content

Commit d98e58b

Browse files
committed
fix(ios): unwrap weak self in DataBrowserViewModel search task to satisfy Task<Void, Never>
1 parent 069e0c8 commit d98e58b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

TableProMobile/TableProMobile/ViewModels/DataBrowserViewModel.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,10 @@ final class DataBrowserViewModel {
270270
pagination.currentPage = 0
271271
pagination.totalRows = nil
272272
searchTask?.cancel()
273-
let task = Task { [weak self] in await self?.load() }
273+
let task = Task { [weak self] in
274+
guard let self else { return }
275+
await self.load()
276+
}
274277
searchTask = task
275278
await task.value
276279
}
@@ -280,7 +283,10 @@ final class DataBrowserViewModel {
280283
pagination.currentPage = 0
281284
pagination.totalRows = nil
282285
searchTask?.cancel()
283-
let task = Task { [weak self] in await self?.load() }
286+
let task = Task { [weak self] in
287+
guard let self else { return }
288+
await self.load()
289+
}
284290
searchTask = task
285291
await task.value
286292
}

0 commit comments

Comments
 (0)