Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FIRST_HIDDEN_ELEMENT is null #108

Merged
merged 1 commit into from
Sep 2, 2022

Conversation

Honny1
Copy link
Member

@Honny1 Honny1 commented Aug 22, 2022

This PR fixes the problem of the unexpected null value of the FIRST_HIDDEN_ELEMENT variable.

How reproduce:

  • It is caused by scrolling down through the report.
  • Error message will appear in the browsers Javascript console

Why:

  • The report uses lazy loading to display the table with rules. When there are no more rules to show. Value of .nextSibling is null.

@Honny1 Honny1 marked this pull request as ready for review August 23, 2022 08:16
@Honny1 Honny1 force-pushed the fix-FIRST_HIDDEN_ELEMENT-is-null branch from ae5868c to dfb83f8 Compare August 23, 2022 12:50
next_five_rules.push(FIRST_HIDDEN_ELEMENT);
if (FIRST_HIDDEN_ELEMENT !== null) {
next_five_rules.push(FIRST_HIDDEN_ELEMENT);
}
FIRST_HIDDEN_ELEMENT = FIRST_HIDDEN_ELEMENT.nextSibling;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If FIRST_HIDDEN_ELEMENT is null this won't work as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is true. But I didn't notice the condition in a loop. So this condition is not necessary.

@Honny1 Honny1 force-pushed the fix-FIRST_HIDDEN_ELEMENT-is-null branch from dfb83f8 to d8c8955 Compare August 23, 2022 14:05
@jan-cerny
Copy link
Member

@Honny1 How does it manifest? When does it happen? From the description I don't know what I should focus on when reviewing this.

@Honny1
Copy link
Member Author

Honny1 commented Aug 30, 2022

@jan-cerny I have updated the description.

@Honny1 Honny1 force-pushed the fix-FIRST_HIDDEN_ELEMENT-is-null branch from d8c8955 to 8f7e35f Compare August 31, 2022 08:10
@Honny1 Honny1 requested a review from evgenyz September 2, 2022 12:34
@evgenyz evgenyz merged commit 1bfdf13 into OpenSCAP:master Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants