Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Squiggly 1.1, Apache Flex 4.14.1
-
None
Description
Steps to reproduce:
- Run the attached project
- Click the "bullet" button
Error details:
[Fault] exception, information=TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.adobe.linguistics.spelling.framework.ui::SparkHighlighter/drawSquigglyLineForRange()[C:\Users\evolverine\workspace\flex-utilities\Squiggly\main\SpellingFramework\src\com\adobe\linguistics\spelling\framework\ui\SparkHighlighter.as:152]
at com.adobe.linguistics.spelling.framework.ui::SparkHighlighter/squiggleWord()[C:\Users\evolverine\workspace\flex-utilities\Squiggly\main\SpellingFramework\src\com\adobe\linguistics\spelling\framework\ui\SparkHighlighter.as:130]
at com.adobe.linguistics.spelling.framework.ui::SparkHighlighter/drawSquiggleAt()[C:\Users\evolverine\workspace\flex-utilities\Squiggly\main\SpellingFramework\src\com\adobe\linguistics\spelling\framework\ui\SparkHighlighter.as:78]
at com.adobe.linguistics.spelling::SpellUI/spellCheckRange()[C:\Users\evolverine\workspace\flex-utilities\Squiggly\main\SpellingUIEx\src\com\adobe\linguistics\spelling\SpellUI.as:395]
at com.adobe.linguistics.spelling::SpellUI/doSpellingJob()[C:\Users\evolverine\workspace\flex-utilities\Squiggly\main\SpellingUIEx\src\com\adobe\linguistics\spelling\SpellUI.as:353]
at com.adobe.linguistics.spelling::SpellUI/handleFocusIn()[C:\Users\evolverine\workspace\flex-utilities\Squiggly\main\SpellingUIEx\src\com\adobe\linguistics\spelling\SpellUI.as:336]
at flash.display::Stage/set focus()
at mx.core::UIComponent/setFocus()[C:\Jenkins\workspace\flex-sdk_release-candidate\frameworks\projects\framework\src\mx\core\UIComponent.as:10437]
at spark.components::RichEditableText/setFocus()[C:\Jenkins\workspace\flex-sdk_release-candidate\frameworks\projects\spark\src\spark\components\RichEditableText.as:3122]
at Test/bullet_clickHandler()[C:\Users\evolverine\Adobe Flash Builder 4.7\FLEX-34756\src\Test.mxml:59]
at Test/__bullet_click()[C:\Users\evolverine\Adobe Flash Builder 4.7\FLEX-34756\src\Test.mxml:106]
Logical summary:
- squiggly is set to spell check when the focus returns to a text field (see SpellUI.handleFocusIn())
- after making changes to the text, the RichEditableText's textFlow is damaged and has to be recomposed. This normally happens in the next frame, when RichEditableText.updateDisplayList calls _textContainerManager.updateContainer().
- BUT if we set focus on the RichEditableText after the text change, squiggly does the spell checking on the damaged textFlow.
- because of this, it's offered bad indexes in SpellUI.getValidFirstWordIndex() and SpellUI.getValidLastWordIndex(), thus checking on non-existing text.