Minor fix to make sure that when logged into the admin and the app is restarted when there's no database, no exception is thrown when attempting to look up the currently logged in user.

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045354
This commit is contained in:
ErikPorter
2010-01-13 20:45:59 +00:00
parent e24a0e230c
commit 8817fbc020
2 changed files with 3 additions and 2 deletions

View File

@@ -1,10 +1,11 @@
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using Orchard.Core.Common.Models;
using Orchard.ContentManagement;
namespace Orchard.Blogs.Models {
public class Blog : ContentPart<BlogRecord> {
[HiddenInput(DisplayValue = false)]
public int Id { get { return ContentItem.Id; } }
[Required]

View File

@@ -101,7 +101,7 @@ namespace Orchard.ContentManagement {
}
//TEMP: this is to transition people with old databases
if (versionRecord == null && !record.Versions.Any() && options.IsPublished) {
if (versionRecord == null && record != null && !record.Versions.Any() && options.IsPublished) {
versionRecord = new ContentItemVersionRecord {
ContentItemRecord = record,
Latest = true,