Quick analysis shows we're force-unwrapping SecureDFUResponse's maxSize, offset and crc. The obvious fix would be to just guard those properties and, if they're not there, to report an Error. But the code-path leading to this code getting executed suggests we might be executing the callback for the wrong type of response, so we're going to sacrifice killing the bug in exchange for perhaps learning new information regarding the root cause of the issue.
The following Stack Trace happens in nRF Connect 2.5.1:
Quick analysis shows we're force-unwrapping
SecureDFUResponse
'smaxSize
,offset
andcrc
. The obvious fix would be to just guard those properties and, if they're not there, to report an Error. But the code-path leading to this code getting executed suggests we might be executing the callback for the wrong type of response, so we're going to sacrifice killing the bug in exchange for perhaps learning new information regarding the root cause of the issue.