diff --git a/simplesamlphp_auth.module b/simplesamlphp_auth.module
index bb76ea9..7d815b1 100644
--- a/simplesamlphp_auth.module
+++ b/simplesamlphp_auth.module
@@ -245,10 +245,13 @@ function simplesamlphp_auth_init() {
 
             if (!empty($user->uid)) {
               // Populate roles based on configuration setting.
-              $roles    = _simplesamlphp_auth_rolepopulation(variable_get('simplesamlphp_auth_rolepopulation', ''));
-              $userinfo = array('roles' => $roles);
-              // @todo Removed role here as it errors when roles are not set.
-              $user     = user_save($user, $userinfo);
+              $rolepopulation = variable_get('simplesamlphp_auth_rolepopulation', '');
+              if (!empty($rolepopulation)) {
+                $roles = _simplesamlphp_auth_rolepopulation($rolepopulation);
+                $userinfo = array('roles' => $roles);
+                // @todo Removed role here as it errors when roles are not set.
+                $user = user_save($user, $userinfo);
+              }
             }
             else {
               // We were unable to register this new user on the site.
@@ -277,11 +280,16 @@ function simplesamlphp_auth_init() {
             // Update the roles.
             // Populate roles based on configuration setting.
             _simplesaml_auth_debug(t('User already registered [%authname] updating roles.', array('%authname' => $authname)));
-            $roles    = _simplesamlphp_auth_rolepopulation(variable_get('simplesamlphp_auth_rolepopulation', ''));
-            $userinfo = array('roles' => $roles);
 
-            // Save the updated roles and populate the user object.
-            $user = user_save($ext_user, $userinfo);
+            $rolepopulation = variable_get('simplesamlphp_auth_rolepopulation', '');
+            // If we have no role assignments configured, do nothing.
+            if (!empty($rolepopulation)) {
+              $roles = _simplesamlphp_auth_rolepopulation($rolepopulation);
+              $userinfo = array('roles' => $roles);
+
+              // Save the updated roles and populate the user object.
+              $user = user_save($ext_user, $userinfo);
+            }
           }
           else {
             // No need to evaluate roles, populate the user object.
