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

TypeError if empty rule is created #4946

Closed
Rebits opened this issue Dec 2, 2022 · 1 comment · Fixed by #4970, #5002 or #5003
Closed

TypeError if empty rule is created #4946

Rebits opened this issue Dec 2, 2022 · 1 comment · Fixed by #4970, #5002 or #5003
Assignees
Labels
qa/report QA Team: Reporting possible bug type/bug Bug issue

Comments

@Rebits
Copy link
Member

Rebits commented Dec 2, 2022

Wazuh Elastic Rev Security
4.4 7.17 1
Browser
Chrome, Firefox, Safari, etc

Description

The creation of a new rule file, without any rule defined, causes an unexpected TypeError.

Full log

this.props.state is undefined:

_callee$@https://172.31.17.26/440/bundles/plugin/wazuh/wazuh.chunk.10.js:5:3983852
tryCatch@https://172.31.17.26/440/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:6:84173
invoke@https://172.31.17.26/440/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:6:88197
defineIteratorMethods/</<@https://172.31.17.26/440/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:6:85368
file_editor_asyncGeneratorStep@https://172.31.17.26/440/bundles/plugin/wazuh/wazuh.chunk.10.js:5:3976974
_throw@https://172.31.17.26/440/bundles/plugin/wazuh/wazuh.chunk.10.js:5:3977424

Steps to reproduce

  1. Navigate to Management>Rules
  2. Set a valid rule filename
  3. Save the new empty rule file

Expected Result

  1. Only Error file content is incorrect should appear

Actual Result

  1. A non-expected TypeError pannel appears at save time.

Screenshots
typeerror

Video

typeerror.webm
@Machi3mfl
Copy link
Member

Solution

Added conditions to show enabled the "Save" button in the File Editor

  • The file must have filename, and the content must change and not empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qa/report QA Team: Reporting possible bug type/bug Bug issue
Projects
No open projects
Status: Done
2 participants