Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 85:         for (int i = 0; i < 7; i++)
Line 86:         {
Line 87:             crFont = new Font((Application["Kunstler Script Font"] as PrivateFontCollection).Families[0], sizes[i], FontStyle.Bold);
Line 88:             crSize = g.MeasureString("Rago Gallery", crFont);
Line 89: 

Source File: D:\HostingSpaces\ragogallery.com\httpdocs\LoadImage.aspx.cs    Line: 87

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   LoadImage.getResizedImage(Byte[] source, Int32 width, Int32 height, Int32 stat) in D:\HostingSpaces\ragogallery.com\httpdocs\LoadImage.aspx.cs:87
   LoadImage.Page_Load(Object sender, EventArgs e) in D:\HostingSpaces\ragogallery.com\httpdocs\LoadImage.aspx.cs:31
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0