Skip to content

Commit ae60635

Browse files
committed
Fix the handling of restricted user profiles
See https://www.woltlab.com/community/thread/314987/
1 parent 915f420 commit ae60635

File tree

2 files changed

+13
-2
lines changed
  • ts/WoltLabSuite/Core/Controller/User
  • wcfsetup/install/files/js/WoltLabSuite/Core/Controller/User

2 files changed

+13
-2
lines changed

ts/WoltLabSuite/Core/Controller/User/Profile.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@ function setupVisitorList(userId: number): void {
5050
const tabContentLoaded = new Map<string, boolean>();
5151

5252
function setupTabMenu(userId: number): void {
53+
const content = document.getElementById("profileContent");
54+
if (content === null) {
55+
// Profile is restricted and the current user cannot see the contents.
56+
return;
57+
}
58+
5359
// Mark the default tab as loaded.
54-
tabContentLoaded.set(document.getElementById("profileContent")!.dataset.active!, true);
60+
tabContentLoaded.set(content.dataset.active!, true);
5561

5662
// Load the content of the active tab, as we do not receive an event for it.
5763
void loadTabMenuContent(userId, getTabMenu("profileContent")!.getActiveTab().dataset.name!);

wcfsetup/install/files/js/WoltLabSuite/Core/Controller/User/Profile.js

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)