Fix segfault in update_type_keywords().

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/editor-struct@2769 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2008-07-11 14:25:26 +00:00
parent 0ae04ea2f9
commit ad6b64647d
2 changed files with 4 additions and 3 deletions

View File

@ -5,6 +5,8 @@
checks for doc->editor->scintilla != NULL will segfault for invalid
documents - check against doc->is_valid or doc->editor != NULL
instead.
* src/document.c:
Fix segfault in update_type_keywords().
2008-07-08 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>

View File

@ -2044,10 +2044,9 @@ static gboolean update_type_keywords(GeanyDocument *doc, gint lang)
for (n = 0; n < documents_array->len; n++)
{
ScintillaObject *wid = documents[n]->editor->scintilla;
if (wid)
if (documents[n]->is_valid)
{
ScintillaObject *wid = documents[n]->editor->scintilla;
gint keyword_idx = editor_lexer_get_type_keyword_idx(sci_get_lexer(wid));
if (keyword_idx > 0)