Why does getPlayHead() still return a pointer?

First off: I know some DAWs don’t have a playhead or only implement transport information partially.

But my question is this:
Say I got this code:

auto playHead = getPlayHead();

that returns a pointer. before JUCE changed its playHead-implementation one could just check if that thing is nullptr and then knew if information existed and go on. Now you have to follow that up with getPosition for some reason.

auto playHead = getPlayHead();
if(playHead)
{
    auto playHeadPos = playHead->getPosition();
    if(playHeadPos)
    {
        // actual stuff
    }
}

now i’m wondering what even is the function of these 2 individual initial nullptr-checks (i just learned we don’t call it nullptr in an optional, but it seems to be basically the same thing)? aren’t they both asking for the same thing, which is wether or not a playHead exists at all? In that case wouldn’t it make more sense to let getPlayHead() return a reference to clearly communicate to the developer that the playHead-object definitely exists, but just its position object does not? Or am I missing something and these 2 ask for different things when nullptr-checking them?

1 Like