Adding null check for query string parameters in AuditTrail to prevent possible YSOD

This commit is contained in:
Lombiq 2015-06-13 01:02:16 +02:00
parent 9466d91438
commit 66af4a8cdf

View File

@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using Orchard.ContentManagement; using Orchard.ContentManagement;
@ -15,7 +16,9 @@ namespace Orchard.AuditTrail.Services.Models {
var filters = new Filters(updateModel); var filters = new Filters(updateModel);
foreach (string nameValue in nameValues) { foreach (string nameValue in nameValues) {
filters.Add(nameValue, nameValues[nameValue]); if (!String.IsNullOrEmpty(nameValue)) {
filters.Add(nameValue, nameValues[nameValue]);
}
} }
return filters; return filters;