DEV: Fix Ember inspector error on anonymous user (#24042)

This commit is contained in:
Penar Musaraj 2023-10-23 09:24:05 -04:00 committed by GitHub
parent 552cf56afe
commit 0934cc6ece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ export default class MyPostsSectionLink extends BaseSectionLink {
}
get showCount() {
return this.currentUser.sidebarShowCountOfNewItems;
return this.currentUser?.sidebarShowCountOfNewItems;
}
get name() {

View File

@ -28,7 +28,7 @@ export default class ReviewSectionLink extends BaseSectionLink {
get badgeText() {
// force a tracker for reviewable_count by using .get to ensure badgeText
// rerenders when reviewable_count changes
if (this.currentUser.get("reviewable_count") > 0) {
if (this.currentUser?.get("reviewable_count") > 0) {
return I18n.t("sidebar.sections.community.links.review.pending_count", {
count: this.currentUser.reviewable_count,
});