mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
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:
@@ -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]
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user