Skip to content

Commit 4d786e1

Browse files
committed
fix favorites panic (#24197)
* fix favorites panic * oops * Revert "oops" This reverts commit d57c213. * better
1 parent 139bb34 commit 4d786e1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

go/kbfs/libkbfs/favorites.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,18 @@ func (f *Favorites) writeCacheToDisk(ctx context.Context) error {
286286
// InitForTest starts the Favorites cache's internal processing loop without
287287
// loading cached favorites from disk.
288288
func (f *Favorites) InitForTest() {
289+
if f.disabled {
290+
return
291+
}
289292
go f.loop()
290293
}
291294

292295
// Initialize loads the favorites cache from disk and starts listening for
293296
// requests asynchronously.
294297
func (f *Favorites) Initialize(ctx context.Context) {
298+
if f.disabled {
299+
return
300+
}
295301
// load cache from disk
296302
err := f.readCacheFromDisk(ctx)
297303
if err != nil {

0 commit comments

Comments
 (0)