Strange Nullpointer with Spanned
<p>I have some objects with a Spanned attribute. These are filled with HTML code including images. 
On a button click I display the Spanned content in a TextView.
SOMETIMES (and I cannot reproduce this) I get this exception:</p>

<p><code>11-07 23:26:16.707: E/AndroidRuntime(23715): java.lang.NullPointerException
11-07 23:26:16.707: E/AndroidRuntime(23715):    at android.text.SpannableStringBuilder.length(SpannableStringBuilder.java:126)
11-07 23:26:16.707: E/AndroidRuntime(23715):    at android.widget.TextView.setText(TextView.java:2631)
11-07 23:26:16.707: E/AndroidRuntime(23715):    at android.widget.TextView.setText(TextView.java:2598)
11-07 23:26:16.707: E/AndroidRuntime(23715):    at android.widget.TextView.setText(TextView.java:2573)
11-07 23:26:16.707: E/AndroidRuntime(23715):    at [...]</code></p>

<p>In the following second line, the exception is thrown (so the Spanned isnt null!):</p>

<pre><code>if(hasSpanned){
        tv.setText(ans.getTxtS());  
}
</code></pre>

<p>Can anybody help me?</p>
