diff --git a/tasks/main.yml b/tasks/main.yml
index 14c13657db7dcc0ac483d862dc605cacdee60259..f5ab292c14ac9e631bf1541063109a37edfc4cf4 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -88,7 +88,7 @@
       with_items: '{{ drupal_settings|default([]) }}'
       loop_control:
         loop_var: drupal
-      when: siteproject is not defined or siteproject == 'no' or drupal.siteproject is not defined or (siteproject == drupal.siteproject and drupal.src.git.branch == branch)
+      when: siteproject is not defined or siteproject == 'no' or drupal.siteproject is not defined or (siteproject == drupal.siteproject and drupal.src.git.branch|default('master') == branch)
       tags:
         - collect_db_dump
         - collect_asset_archive