Move the check d->viewManager->selectionEditable()
This should be inside the if (d->viewManager) {} block, not outside.
BUG:391054