You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Justin Mclean (JIRA)" <ji...@apache.org> on 2013/04/24 00:55:15 UTC

[jira] [Updated] (FLEX-26948) Null reference in Slider class: updateDisplayList

     [ https://issues.apache.org/jira/browse/FLEX-26948?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Mclean updated FLEX-26948:
---------------------------------

    Labels: easyfix  (was: )
    
> Null reference in Slider class: updateDisplayList
> -------------------------------------------------
>
>                 Key: FLEX-26948
>                 URL: https://issues.apache.org/jira/browse/FLEX-26948
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: mx: Slider
>    Affects Versions: Adobe Flex SDK 4.1 (Release)
>         Environment: Affected OS(s): All OS Platforms
> Browser: Internet Explorer 7.x
> Language Found: English
>            Reporter: Adobe JIRA
>              Labels: easyfix
>
> We ran into a null reference in the mx Slider class, though the steps to reproduce are unknown. It happened in the updateDisplayList function, in the following code snippet:
>    var isHorizontal:Boolean = (_direction == SliderDirection.HORIZONTAL);
>    var numLabels:int = labelObjects ? labelObjects.numChildren : 0;
>    var numThumbs:int = thumbs ? thumbs.numChildren : 0;
>    var trackMargin:Number = getStyle("trackMargin");
>    var widestThumb:Number = 6;
>    var firstThumb:SliderThumb = SliderThumb(thumbs.getChildAt(0));
>    if (thumbs && firstThumb)
>        widestThumb = firstThumb.getExplicitOrMeasuredWidth();
> Note that the statement assigning numThumbs checks for null, but the statement assigning firstThumb does not. We had a null thumbs, which caused the firstThumb assignment to fail.
> The fix should be a simple matter of checking for null thumbs when assigning firstThumb.
>  
>  Actual Results:
>  An ActionScript error has occurred:
>  TypeError: Error #1009: Cannot access a property or method of a null object reference. 
>  
>  Expected Results:
>  No runtime error
>  
>  Workaround (if any):
>  unknown

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira