I have the following code:
Boolean bool = null; try { if (bool) { //DoSomething } } catch (Exception e) { Syst
Boolean types can be null. You need to do a null check as you have set it to null.
Boolean
null
if (bool != null && bool) { //DoSomething }