Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

[Full changelog](https://github.com/mozilla/glean/compare/v66.1.0...main)

* Kotlin
* BUGFIX: For `lateinit` metrics, check that the metric was instantiated before recording on it ([#3309](https://github.com/mozilla/glean/pull/3309))

# v66.1.0 (2025-11-03)

[Full changelog](https://github.com/mozilla/glean/compare/v66.0.1...v66.1.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class BooleanMetricType {
*/
fun set(value: Boolean) {
Dispatchers.Delayed.launch {
inner.set(value)
if (this::inner.isInitialized) {
inner.set(value)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class CounterMetricType {
*/
fun add(amount: Int = 1) {
Dispatchers.Delayed.launch {
inner.add(amount)
if (this::inner.isInitialized) {
inner.add(amount)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class QuantityMetricType {
*/
fun set(value: Long) {
Dispatchers.Delayed.launch {
inner.set(value)
if (this::inner.isInitialized) {
inner.set(value)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class StringMetricType {
*/
fun set(value: String) {
Dispatchers.Delayed.launch {
inner.set(value)
if (this::inner.isInitialized) {
inner.set(value)
}
}
}

Expand Down