Skip to content
Browse files

Fixed crash if attempts to Note were done before output buffer ready

  • Loading branch information...
1 parent 5072cd1 commit 9ac3d519d5608f9ac449e3bc9102e1c54877db11 @nickgammon committed
Showing with 6 additions and 2 deletions.
  1. +4 −0 doc.cpp
  2. +2 −2 scripting/methods/methods_noting.cpp
View
4 doc.cpp
@@ -1797,6 +1797,10 @@ CLine * pOriginalLine = m_pCurrentLine;
CString strOriginalText;
CString strLine (lpszText, size);
+ // cannot go very far without this - must be called at world loadup from a plugin OnPluginInstall
+ if (m_pLinePositions == NULL)
+ return;
+
// decompressed data has a size, not a null terminator.
// Also, compressed data may have imbedded nulls.
View
4 scripting/methods/methods_noting.cpp
@@ -46,7 +46,7 @@ void CMUSHclientDoc::Tell(LPCTSTR Message)
return;
// if output buffer doesn't exist yet, remember note for later
- if (m_pCurrentLine == NULL)
+ if (m_pCurrentLine == NULL || m_pLinePositions == NULL)
{
COLORREF fore = m_iNoteColourFore,
back = m_iNoteColourBack;
@@ -520,7 +520,7 @@ void CMUSHclientDoc::Hyperlink(LPCTSTR Action,
BOOL URL)
{
// return if attempt to do tell (or note) before output buffer exists
- if (m_pCurrentLine == NULL)
+ if (m_pCurrentLine == NULL || m_pLinePositions == NULL)
return;
// don't muck around if empty message

0 comments on commit 9ac3d51

Please sign in to comment.
Something went wrong with that request. Please try again.