 <p>You are only assigning 'checkedIfInsured' inside an 'if' block. If the condition doesn't hold, it won't get assigned, and that is what the compiler is complaining about.</p> <p>Make sure you assign 'checkedIfInsured' outside the 'if' block.</p>