To reduce nested IF:
1/ early return;
2/ compound expression (short-circuit aware)
So, your example may be refactored like this:
if( FileExists(file) && SomeTest(contents = OpenFile(file)) )
{
DoSomething(contents);
return;
}
DefaultAction();
if( FileExists(file) && SomeTest(contents = OpenFile(file)) )
{
DoSomething(contents);
return;
}
DefaultAction();