Quantcast
Viewing all articles
Browse latest Browse all 801

Closed Issue: NullPointerException in MultipleToSingleLineStringConverter [10474]

<p>HubTileConverter.cs throws an NullPointerException in Line 20 if the value to be converted is NULL</p>
<p>&#160;</p>
<p>Old:</p>
<p>&#160;</p>
<p> internal class MultipleToSingleLineStringConverter : IValueConverter</p>
<p> {</p>
<p> public object Convert(object value, Type targetType, object parameter, CultureInfo culture)</p>
<p> {</p>
<p> return ((string)value).Replace(Environment.NewLine, &quot; &quot;);</p>
<p> }</p>
<p>&#160;</p>
<p>Fix:</p>
<p> internal class MultipleToSingleLineStringConverter : IValueConverter</p>
<p> {</p>
<p> public object Convert(object value, Type targetType, object parameter, CultureInfo culture)</p>
<p> {</p>
<p> if (string.IsNullOrEmpty(value as string))</p>
<p> return string.Empty;</p>
<p> return (value as string).Replace(Environment.NewLine, &quot; &quot;);</p>
<p> }</p>
Comments:

Closing all issues marked as fixed, dupe or no repro for the Windows Phone Toolkit September 2012 release.


Viewing all articles
Browse latest Browse all 801

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>