Link to home
Start Free TrialLog in
Avatar of bemara57
bemara57

asked on

Does multiple condition stop at the first 'false'?

Say a condition has multiple checks like this:

            if (reader != null && !reader.IsClosed)

Does the condition stop if 'reader' is null, or does it continue to even check reader.IsClosed? If it does it would throw an exception because because it's null. Or is this code safe because the 'if' condition breaks as soon as it finds that read is null?
ASKER CERTIFIED SOLUTION
Avatar of tigin44
tigin44
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial