Thank you for bringing this to our attention. We have logged a ticket with our Documentation Team to get this page updated, in the meantime, as a workaround you can declare the following:
As by default AActor::GetRootComponent() returns NULL, the body of the if construct will never be executed (the condition is always false). As a result the actor will not work as the tutorial expects.
The proper approach is instantiating a component and set it as the root component.
The if construct is not needed at all.