Error : System.NullReferenceException: Object reference not set to an instance of an object. at CKFinder.Settings.AccessControlManager.GetComputedMask(String resourceType, String folderPath) in D:\CKFinder\CKFinder.Net\Settings\AccessControlManager.cs:line 79 at CKFinder.Connector.CommandHandlers.InitCommandHandler.BuildXml() in D:\CKFinder\CKFinder.Net\Connector\CommandHandlers\InitCommandHandler.cs:line 97 at CKFinder.Connector.CommandHandlers.XmlCommandHandlerBase.SendResponse(HttpResponse response) in D:\CKFinder\CKFinder.Net\Connector\CommandHandlers\XmlCommandHandlerBase.cs:line 88 at CKFinder.Connector.Connector.OnLoad(EventArgs e) in D:\CKFinder\CKFinder.Net\Connector\Connector.cs:line 161 at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
// AccessControlManager.cs
public int GetComputedMask( string resourceType, string folderPath )
{
if ( !_IsAclEntriesComputed )
ComputeAclEntries();
int computedMask = 0;
// Get the user role from the session.
string userRole = null;
if ( ConfigFile.Current.RoleSessionVar.Length > 0 )
userRole = System.Web.HttpContext.Current.Session[ ConfigFile.Current.RoleSessionVar ] as string;
if ( userRole != null && userRole.Length == 0 )
userRole = null;
// Take the folder parts.
folderPath = folderPath.Trim( '/' );
string[] pathParts = folderPath.Split( '/' );
string currentPath = "/";
for ( int i = -1 ; i < pathParts.Length ; i++ )
{
if ( i >= 0 )
{
if ( pathParts[ i ].Length == 0 )
continue;
if ( _ComputedAclEntries.ContainsKey( currentPath + "*/" ) )
computedMask = this.MergePathComputedMask( computedMask, resourceType, userRole, currentPath + "*/" );
currentPath += pathParts[ i ] + "/";
}
if ( _ComputedAclEntries.ContainsKey( currentPath ) )
computedMask = this.MergePathComputedMask( computedMask, resourceType, userRole, currentPath );
}
return computedMask;
} // InitCommandHandler.cs
for ( int i = 0 ; i < aTypes.Length ; i++ )
{
string resourceTypeName = aTypes[ i ];
int aclMask = Config.Current.AccessControl.GetComputedMask( resourceTypeName, "/" );
if ( ( aclMask & (int)AccessControlRules.FolderView ) != (int)AccessControlRules.FolderView )
continue;
Settings.ResourceType oTypeInfo = _Config.GetResourceTypeConfig( resourceTypeName );
string sTargetDirectory = oTypeInfo.GetTargetDirectory();
bool bHasChildren = System.IO.Directory.Exists( sTargetDirectory ) && ( System.IO.Directory.GetDirectories( oTypeInfo.GetTargetDirectory() ).Length > 0 );
XmlNode oResourceType = XmlUtil.AppendElement( oResourceTypes, "ResourceType" );
XmlUtil.SetAttribute( oResourceType, "name", resourceTypeName );
XmlUtil.SetAttribute( oResourceType, "url", oTypeInfo.Url );
XmlUtil.SetAttribute( oResourceType, "allowedExtensions", string.Join( ",", oTypeInfo.AllowedExtensions ) );
XmlUtil.SetAttribute( oResourceType, "deniedExtensions", string.Join( ",", oTypeInfo.DeniedExtensions ) );
XmlUtil.SetAttribute( oResourceType, "hash", Util.GetMd5Hash( sTargetDirectory ).Substring( 0, 16 ) );
XmlUtil.SetAttribute( oResourceType, "defaultView", "Thumbnails" );
XmlUtil.SetAttribute( oResourceType, "hasChildren", ( bHasChildren ? "true" : "false" ) );
XmlUtil.SetAttribute( oResourceType, "acl", aclMask.ToString() );
}
Re: Unknown Error & System.NullReferenceException
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+