Fixing blocker bug 106474. Make nsAFlatString::GetReadableFragment() deal with a null buffer handles correctly. r=kin@netscape.com, sr=scc@mozilla.org

This commit is contained in:
jst%netscape.com 2001-10-24 19:29:42 +00:00
parent 671634a107
commit 285c5940f6
2 changed files with 6 additions and 2 deletions

View File

@ -33,7 +33,9 @@ nsAFlatString::GetReadableFragment( const_fragment_type& aFragment, nsFragmentRe
case kFragmentAt:
{
const buffer_handle_type* buffer = GetBufferHandle();
NS_ASSERTION(buffer, "trouble: no buffer!");
if ( !buffer )
return 0;
aFragment.mEnd = buffer->DataEnd();
return (aFragment.mStart = buffer->DataStart()) + aOffset;

View File

@ -33,7 +33,9 @@ nsAFlatString::GetReadableFragment( const_fragment_type& aFragment, nsFragmentRe
case kFragmentAt:
{
const buffer_handle_type* buffer = GetBufferHandle();
NS_ASSERTION(buffer, "trouble: no buffer!");
if ( !buffer )
return 0;
aFragment.mEnd = buffer->DataEnd();
return (aFragment.mStart = buffer->DataStart()) + aOffset;