Do not execute hooks on empty projects, fixes #6108
Merge pull request #7383 from Razer6/fix_test_hooks_empty_project

Do not execute hooks on empty projects, fixes #6108