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:
wmayer
2023-08-29 00:45:27 +02:00
parent f0152cbcce
commit 93090fa55b

View File

@@ -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()) {