#20083: Fixing Projection import with no layouts

Work Item: 20083
This commit is contained in:
kassobasi
2014-03-14 18:06:45 -07:00
committed by Sebastien Ros
parent 1b1f04a9c6
commit ab72235c3f

View File

@@ -311,8 +311,8 @@ namespace Orchard.Projections.Drivers {
int layoutIndexValue;
if (layoutIndex != null
&& Int32.TryParse(layoutIndex, out layoutIndexValue)
&& layoutIndexValue != -1
&& part.Record.QueryPartRecord.Layouts.Count >= layoutIndexValue + 1)
&& layoutIndexValue >= 0
&& part.Record.QueryPartRecord.Layouts.Count > layoutIndexValue)
{
part.Record.LayoutRecord = part.Record.QueryPartRecord.Layouts[Int32.Parse(layoutIndex)];
}