Gui: no need to check for nullptr when using dynamic_cast
It's explicitly allowed to use dynamic_cast on a nullptr and the result will be a nullptr too. See https://en.cppreference.com/w/cpp/language/dynamic_cast
This commit is contained in:
@@ -181,12 +181,7 @@ int SoFCSelectionContextEx::merge(int status, SoFCSelectionContextBasePtr &outpu
|
||||
SoFCSelectionContextBasePtr input, SoNode *node)
|
||||
{
|
||||
auto ctx = std::dynamic_pointer_cast<SoFCSelectionContextEx>(input);
|
||||
SoFCSelectionRoot* selectionNode;
|
||||
if (node == nullptr) {
|
||||
selectionNode = nullptr;
|
||||
} else {
|
||||
selectionNode = dynamic_cast<SoFCSelectionRoot*>(node);
|
||||
}
|
||||
SoFCSelectionRoot* selectionNode = dynamic_cast<SoFCSelectionRoot*>(node);
|
||||
|
||||
if(!ctx) {
|
||||
if(selectionNode && selectionNode->hasColorOverride()) {
|
||||
|
||||
Reference in New Issue
Block a user