Description: Fix startup bug where scribbleArea not defined in editor
Origin: PR @ upstream: https://github.com/pencil2d/pencil/pull/392
Author: JonasThomas <jonasthomasmsm@gmail.com>
Acked-By: Mattia Rizzolo <mattia@debian.org>
Last-Date: Tue, 29 Dec 2015 20:39:27 -0600

---
 app/mainwindow2.cpp        |  1 +
 core_lib/tool/basetool.cpp | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/app/mainwindow2.cpp b/app/mainwindow2.cpp
index 9f1589e..d7a6631 100644
--- a/app/mainwindow2.cpp
+++ b/app/mainwindow2.cpp
@@ -91,6 +91,7 @@ MainWindow2::MainWindow2( QWidget *parent ) : QMainWindow( parent )
     object->init();
 
     mEditor = new Editor( this );
+    mEditor->setScribbleArea(mScribbleArea);
     mEditor->init();
     mEditor->setObject( object );
 
diff --git a/core_lib/tool/basetool.cpp b/core_lib/tool/basetool.cpp
index 75065dc..566a9f1 100644
--- a/core_lib/tool/basetool.cpp
+++ b/core_lib/tool/basetool.cpp
@@ -57,6 +57,16 @@ void BaseTool::initialize( Editor* editor )
     }
     mEditor = editor;
     mScribbleArea = editor->getScribbleArea();
+
+
+    Q_ASSERT( mScribbleArea );
+
+    if ( mScribbleArea == NULL )
+    {
+        qCritical( "ERROR: mScribbleArea is null in editor!" );
+    }
+
+
     m_pStrokeManager = mEditor->getScribbleArea()->getStrokeManager();
 
     loadSettings();
