MCASV crash when samples not fully populated
Currently the MCASV crashes due to derefferencing a (shared) nullptr (https://gitlab.cern.ch/atlas-caf/CAFCore/-/blob/master/QFramework/Root/TQSampleVisitor.cxx#L495). While this should certainly be caught (and result in a runtime error instead of a plain crash), the underlying issue also needs addressing.
Following a report from @dkisliuk it appears that an empty SampleFolder (i.e. one without any Samples or other SampleFolders inside) does not even become a Friend of itself. While this part of the behavior may be fine it will also trickle down towards the root node, preventing partially populated SampleFolders from properly creating their Friends list (thus triggering the segfault described above).
To be clarified: should empty SampleFolders be friends of each other if they fulfill other criteria (same depth, any others?) or should these retain an empty/non-existent FriendsList? In favor of having them as Friends would be that even a single dummy SF would be safely a friend of itself and thus work fine with Friend-aware SampleVisitors. Also, I currently don't see an iminent downside to this way.
To fix:
- check for nullptr -> throw proper error
- ignore subFolders during Friends checking if both (own+other's subfolder) have no friends at all even after explicitly triggering FriendFinding on one of them.
- (TBC) allow empty folders to become friends.