FIX: set `null` to group if `groupAttrs` param is not available. (#14795)

FIX: set null to group if groupAttrs param is not available. (#14795)

Because of this bug “all groups” option in the group selector dropdown was not selectable on the user directory page.

diff --git a/app/assets/javascripts/discourse/app/controllers/users.js b/app/assets/javascripts/discourse/app/controllers/users.js
index ce5fd7e..9068325 100644
--- a/app/assets/javascripts/discourse/app/controllers/users.js
+++ b/app/assets/javascripts/discourse/app/controllers/users.js
@@ -83,7 +83,7 @@ export default Controller.extend({
   @action
   groupChanged(_, groupAttrs) {
     // First param is the group name, which include none or 'all groups'. Ignore this and look at second param.
-    this.set("group", groupAttrs.id);
+    this.set("group", groupAttrs?.id);
   },
 
   @action

GitHub sha: 2b848213f7dc6999ddf0809e68e1ceb980597c9d

This commit appears in #14795 which was approved by eviltrout. It was merged by vinothkannans.