From e51d119fa617cf681e3e857be729b15aec6f739b Mon Sep 17 00:00:00 2001
From: Manuel Herrmann <it@icetruck.de>
Date: Sun, 21 Sep 2014 16:12:14 +0200
Subject: [PATCH] dont start story mode w/o storybox

---
 registration-system/view/js/story.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/registration-system/view/js/story.js b/registration-system/view/js/story.js
index 5f245c0..8f53621 100644
--- a/registration-system/view/js/story.js
+++ b/registration-system/view/js/story.js
@@ -269,7 +269,12 @@ Story.prototype.addFormText = function(parentNode, label, fieldName, x, y)
 	this.form_variables[fieldName] = null;
 }
 
-$(function() {
-	story = new Story($('#storyhead'), $('#storycanvas'), $('#storybox'));
-	story.begin();
+$(function()
+{
+	var storybox = $('#storybox');
+	if (storybox)
+	{
+		story = new Story($('#storyhead'), $('#storycanvas'), storybox);
+		story.begin();
+	}
 });
-- 
GitLab