[conditionformat2] Plug-in stops working if Date is null
will-yama opened this issue · 1 comments
If a Date field is placed in the Text Format conditions settings, and the date inside a record has no value, the plug-in stops coloring in any cells that come after that field.
Bug Replication
- Create an App with a Date field and a Text field
- Set the Conditional Format plug-in, with the below settings
Text Format Condition
Field with condition | Condition | Value | Field to Format | Font Color | Background Color | Font Size | Style |
---|---|---|---|---|---|---|---|
Date | = | 2018-09-14 | Date | #2500FF | #FF0000 | Normal | Normal |
Text | = | test | Text | #2500FF | #FF0000 | Normal | Normal |
Save the settings and update the App.
-
Add a record into the App.
Place no value inside the Date field.
Place the value test into the Text field -
After saving, view the Record Details page or the Record List page.
What should happen
Date field is not styled (as the condition does not match).
Text field is styled with blue text and red background.
What actually happens
Date field is not styled.
Text field is also not styled.
An error appears in the console:
"Uncaught TypeError: Cannot read property 'match' of null"
Thoughts
There is an if statement in desktop.js that compares the "field" variable, but this field variable will have no properties if it is null. Probably needs to check if the value is null first before going into this statement.