AddDocumentTask has two constructors. In the second task creates a project if there is no one, but in the first task do nothing and fall.
Add a project creating to the first constructor.
Also, fix possible crashes: do not use pointers (like Document * _d and DocumentProviderTask * _dpt) if they are NULLin both constructors.