mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixing exception when the Default layer doesn't exist
This commit is contained in:
@@ -69,7 +69,8 @@ namespace Orchard.Widgets.Controllers {
|
||||
}
|
||||
|
||||
LayerPart currentLayer = layerId == null
|
||||
? layers.FirstOrDefault(x => x.Name == "Default")
|
||||
// look for the "Default" layer, or take the first if it doesn't exist
|
||||
? layers.FirstOrDefault(x => x.Name == "Default") ?? layers.FirstOrDefault()
|
||||
: layers.FirstOrDefault(layer => layer.Id == layerId);
|
||||
|
||||
if (currentLayer == null && layerId != null) { // Incorrect layer id passed
|
||||
|
Reference in New Issue
Block a user