Skip to content

Commit

Permalink
Fixed EditorViewport crash on keypresses
Browse files Browse the repository at this point in the history
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
metatari committed Nov 16, 2012
1 parent 0f0bedd commit 2ef4ec7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/UI/EditorViewport.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 2ef4ec7

Please sign in to comment.