Yesterday I was strugling to create a new template for Sitefinity. I converted it from one of Free CSS Templates and only put several ContentPlaceHolders. After uploading to SF and clickind "Edit this template" button I got NullReferenceException. Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
It took me a while to figure it out, but the problem was simply that I haven't included the <form> tag required for ASP.NET.
So at least for me this error was quite missleading and I hope you can came up with a better error handling to catch this.