View Single Post
  #8 (permalink)  
Old December 31st, 2007, 06:05 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Haha, don't worry about it....

I just thought that this:

System.Threading.Thread.CurrentPrincipal = (System.Security.Principal.IPrincipal)Session["CSLA-Principal"];

would cause an exception when Session["CSLA-Principal"] is null. However, apparently it's OK to cast null to a System.Security.Principal.IPrincipal and assign it. Funny thing is indeed that after the null assignment, System.Threading.Thread.CurrentPrincipal is still a valid object, so it seems the assignment is either ignored or reset....

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.