summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_bytestring.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/cfx_bytestring.h')
-rw-r--r--core/fxcrt/cfx_bytestring.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fxcrt/cfx_bytestring.h b/core/fxcrt/cfx_bytestring.h
index 3e8b6619c2..0e8e006a3c 100644
--- a/core/fxcrt/cfx_bytestring.h
+++ b/core/fxcrt/cfx_bytestring.h
@@ -107,9 +107,9 @@ class CFX_ByteString {
const CFX_ByteString& operator+=(const CFX_ByteString& str);
const CFX_ByteString& operator+=(const CFX_ByteStringC& bstrc);
- const CharType& operator[](const FX_STRSIZE index) const {
+ CharType operator[](const FX_STRSIZE index) const {
ASSERT(index >= 0 && index < GetLength());
- return m_pData->m_String[index];
+ return m_pData ? m_pData->m_String[index] : 0;
}
void SetAt(FX_STRSIZE index, char c);