Error creating new pages
EPF-66
diff --git a/source/app/controllers/pages_controller.rb b/source/app/controllers/pages_controller.rb
index ee54bfe..be20b76 100644
--- a/source/app/controllers/pages_controller.rb
+++ b/source/app/controllers/pages_controller.rb
@@ -66,7 +66,7 @@
     if params[:checkout_id]
       @checkout = Checkout.find(params[:checkout_id])
       v0 = @checkout.version.previous_version 
-      if v0.version == 0
+      if v0 and v0.version == 0 # v0 can be in nil in case of new page
         unless File.exists? v0.path(true) # we also want version 0 in TinyMCE format
           h = v0.html
           h = h.gsub(Page::BODY_TAG_PATTERN, '<body>')