diff --git a/pallets/ocex/src/validator.rs b/pallets/ocex/src/validator.rs index 96eb86352..398c9e932 100644 --- a/pallets/ocex/src/validator.rs +++ b/pallets/ocex/src/validator.rs @@ -756,7 +756,13 @@ impl Pallet { ) -> Result<(), &'static str> { let mut config = get_lmp_config(state, current_on_chain_epoch)?; // We wrap around the index if we overflow - let next_index = config.index.checked_add(1).unwrap_or(0); + let next_index = match config.index.checked_add(1) { + None => { + log::error!(target:"ocex","Index overflow for LMPConfig {:?}", config.index); + 0 + }, + Some(index) => index, + }; for (main, score) in scores { store_q_score_and_uptime( state,