Permalink
Browse files

Fixed possible crash on indent

  • Loading branch information...
1 parent 30f0499 commit abba0f9256ba461963c5805cc00cfc870e7b4731 @bmcdorman bmcdorman committed Aug 15, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/SourceFile.cpp
View
3 src/SourceFile.cpp
@@ -275,7 +275,8 @@ bool SourceFile::openProjectFile(Project* project, const TinyNode* node)
void SourceFile::indentAll()
{
if(!ui_editor->lexer()) return;
- if(!dynamic_cast<Lexer::LexerBase*>(ui_editor->lexer())->cStyleBlocks()) return;
+ LexerBase *lexerBase = dynamic_cast<Lexer::LexerBase*>(ui_editor->lexer());
+ if(!lexerBase || !lexerBase->cStyleBlocks()) return;
setUpdatesEnabled(false);

0 comments on commit abba0f9

Please sign in to comment.