Skip to content

search: fix panic when requesting language stats

Administrator requested to merge cw/fix-lang-stats into main

Created by: chwarwick

Conversion from log15 missed a case where the language stats were retrieved from cache causing the logger to be nil.

resolves https://github.com/sourcegraph/sourcegraph/issues/41511

Test plan

Ran lang stats query multiple times from the api console to ensure I hit the cache and confirmed it no long caused a panic.

query LangStatsInsightContent($query: String!) {
  search(query: $query) {
    results {
      limitHit
    }
    stats {
      languages {
        name
        totalLines
      }
    }
  }
}

Merge request reports

Loading