Isn’t this "just in case” code?

Why doesn’t the subclass just override the data setter if it doesn’t have a 
link? (and why doesn’t it have one?)

Harbs

> On Oct 26, 2017, at 11:45 PM, pio...@apache.org wrote:
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> piotrz pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
> 
> 
> The following commit(s) were added to refs/heads/develop by this push:
>     new 37b243e  Fix issue where setting "href" in a custom item renderer 
> based on FooterLinkItemRenderer causes NPE
> 37b243e is described below
> 
> commit 37b243e5badc88a23816118c86ececb4f0ded96c
> Author: Piotr Zarzycki <piotrzarzyck...@gmail.com>
> AuthorDate: Thu Oct 26 22:44:59 2017 +0200
> 
>    Fix issue where setting "href" in a custom item renderer based on 
> FooterLinkItemRenderer causes NPE
> ---
> .../royale/mdl/itemRenderers/FooterLinkItemRenderer.as       | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git 
> a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/itemRenderers/FooterLinkItemRenderer.as
>  
> b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/itemRenderers/FooterLinkItemRenderer.as
> index 19fd057..babab26 100644
> --- 
> a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/itemRenderers/FooterLinkItemRenderer.as
> +++ 
> b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/itemRenderers/FooterLinkItemRenderer.as
> @@ -85,11 +85,6 @@ package org.apache.royale.mdl.itemRenderers
>               public function set href(value:String):void
>               {
>             _href = value;
> -            
> -            COMPILE::JS
> -            {
> -                (a as HTMLElement).setAttribute('href', value);
> -            }
>               }
> 
>               COMPILE::JS
> @@ -121,7 +116,12 @@ package org.apache.royale.mdl.itemRenderers
>                               if(textNode != null)
>                               {
>                                       textNode.nodeValue = text;
> -                             }       
> +                             }
> +
> +                if (a != null)
> +                {
> +                    (a as HTMLElement).setAttribute('href', href);
> +                }
>                       }
>               }
> 
> 
> -- 
> To stop receiving notification emails like this one, please contact
> ['"comm...@royale.apache.org" <comm...@royale.apache.org>'].

Reply via email to