Browse files

Fixed EditorViewport crash on keypresses

Before, EditorViewport would start accessing arrays on keypresses (specifically
the arrow keys) even when there were no editors.  This adds an extra check to
prevent this.
  • Loading branch information...
1 parent 0f0bedd commit 2ef4ec756592dcd7e0160aacd54fa03349c6475e @akmokhtari committed Nov 16, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 Source/UI/EditorViewport.cpp
View
2 Source/UI/EditorViewport.cpp
@@ -522,7 +522,7 @@ bool EditorViewport::keyPressed (const KeyPress &key) {
//std::cout << "Editor viewport received " << key.getKeyCode() << std::endl;
- if (canEdit)
+ if (canEdit && editorArray.size() > 0)
{
ModifierKeys mk = key.getModifiers();

0 comments on commit 2ef4ec7

Please sign in to comment.