Check if project.repository before check

Fix for #2776