Object Reference Not Set in Constructor With Special Characters

Posted by: djenurm on 27 September 2017, 8:47 pm EST

  • Posted 27 September 2017, 8:47 pm EST

    We are seeing an odd issue with the C1Editor control when we are running our code under a Windows user account that contains a special character in the name (an apostrophe: ’ , tilde: ~, or pound sign #). When we try to load a form with a c1editor control on it under these conditions (the user with special chars in their windows username), the code throws an error in the Constructor portion of the code. We’ve been able to duplicate this multiple times on Windows 7, unsure if Windows 8 still exhibits the same issues.

    The relevant portion of the stack trace from that error is as follows:

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

    at C1.Win.C1Editor.Internal.XmlValidator.CorrectCharset(XmlDocument xmlDoc, Boolean convertToUTF8, Encoding& encoding)

    at C1.Win.C1Editor.Internal.XmlValidator.a(XmlDocument A_0, ConvertExtraWhitespacesMode A_1, Boolean A_2)

    at C1.Win.C1Editor.Internal.XmlValidator.LoadXmlDocument(XmlDocument xmlDoc, String xml, Boolean autofix, Boolean useXhtmlDtd, ConvertExtraWhitespacesMode convertExtraWhitespacesMode, CustomValidateErrorDialog customDialog, Boolean removeEmptyInlineTags, Boolean strict)

    at C1.Win.C1Editor.Internal.XmlValidator.LoadXmlDocument(XmlDocument xmlDoc, String xml, Boolean autofix, Boolean useXhtmlDtd, ConvertExtraWhitespacesMode convertExtraWhitespacesMode, CustomValidateErrorDialog customDialog)

    at C1.Win.C1Editor.Internal.EditorXmlDocument.Load(String xml, Boolean autoFix, Boolean convertToUTF8, CustomValidateErrorDialog customDialog)

    at C1.Win.C1Editor.C1Editor.LoadDocument(String xml, Uri uri, Boolean autoFix, CustomValidateErrorDialog customDialog, DocumentFormat format)

    at C1.Win.C1Editor.C1Editor.InitDocument()

    at C1.Win.C1Editor.C1Editor…ctor()

    at TC.frmFUP.InitializeComponent()

    at TC.frmMain…ctor()

    In this case, we’re not even to the point of populating any information within the C1Editor, it’s merely the construction of that control that is throwing the error. Is there any workaround for this issue?

  • Posted 27 September 2017, 8:47 pm EST

    Hello,

    We are sorry to mention but we could not replicate the issue at our end. Could you please elaborate as in when you are facing this issue? How are you able to replicate the issue at your end?

    What all steps are you following?

    It would be really helpful for us if you can share a sample application with us along with some screenshots or video demonstrating the issue. So, we could reproduce the same at our end and can assist you further at the earliest.

    Also, share the environment details of the system where you can replicate the issue.

    Regards,

    Arpit Jain

  • Posted 27 September 2017, 8:47 pm EST

    This issue is easy to duplicate on our end. I’m attaching a simple project that exhibits the same behavior. When run with an account that does not have special characters in the name, it runs properly, and when run with one that does contain a special character, it crashes.

    1. Create an Additional Windows user on the computer with an apostrophe included in the name. In my example, I’ve used “Danny O’Malley” for my testing. I gave Danny administrative permissions on the machine so that I could easily access the project location; however, the user also exhibits the same issue with Standard permissions.

    2. Create a simple VB.Net Windows Forms project targeting .Net 2.0. Include a reference to the C1Editor component for .Net 2.0, and add a C1Editor control to the Form.

    3. Run the project using the normal windows account and verify it runs appropriately.

    4. Switch users to the new account you created with the apostrophe. Run the project. The compiled executable for the project I attached crashes on our system when run under these conditions.

    2015/05/C1EditorTestVB.zip

  • Posted 27 September 2017, 8:47 pm EST

    Hello,

    Thank you for providing the sample application and the detailed explanation.

    However, we are sorry to mention but we could not replicate the issue at our end using the given sample and the user account name.

    Please refer to the attached video demonstrating the behavior at our end.

    Therefore, we would request you to please share the exact environment details of the system in which you can replicate the issue. So, it would be helpful for us in reproducing the same at our end and assisting you further accordingly.

    Regards,

    Arpit Jain

    2015/05/avi_C1EditorTest.gif

  • Posted 27 September 2017, 8:47 pm EST

    We are using the same version of the control as you showed in the video: 2.0.20142.214 and also running Windows 7 64bit. The user account was created like you showed, and after logging in as the user that we created, the problem surfaces. We’ve seen this exact issue occur on multiple different machines, all which had the issue fixed when we deleted the user account and recreated it without the special characters.

  • Posted 27 September 2017, 8:47 pm EST

    I’m also seeing issues when simply adding the control to a VB.Net Windows Form when logged in with the account with the apostrophe in it. When doing so, the attached error message is displayed. Previously, we’d created the test project in the account that contains no apostrophe, and running it in the other caused the crash. Now when assembling the project in the “Danny O’Malley” account, it pops up the same stack trace error when adding the C1Editor control to a VB.Net form.

  • Posted 27 September 2017, 8:47 pm EST

    Hello,

    Apologies for the inconvenience caused.

    We are still working on your issue and will get back to you as soon as it is done.

    We understand that you are facing this issue and we are trying our best to get it done at the earliest.

    Regards,

    Arpit Jain

  • Posted 27 September 2017, 8:47 pm EST

    Hello,

    Apologies for the delayed response.

    We could replicate both the issues at our end. We have escalated this to the development team and will let you know as soon as there is any reply from them.

    The tracking id for the issue is : 118937

    Regards,

    Arpit Jain

  • Posted 27 November 2017, 3:33 am EST

    Hi,

    Can you please let me know if the problem persists on using VS 2015 at your end as well? I would like to investigate it further in that case.

    ~Pragati

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels