After loading a psd and wanting to do Textlayer.TextData.UpdateLayerData(), it throws an error:
“Object reference not set to an instance of an object.”.
This error only occurs for version 23.9, however if I use a previous version no error is generated, but I need to update the version to resolve a bug.
Code used:
code-bug-null-reference-UpdateData.zip (808 Bytes)
Psd used:
psd-input-bug-null-reference-UpdateData.zip (2.8 MB)
@cristianortegaethofy
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PSDNET-1744
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@cristianortegaethofy I can’t reproduce your issue, I used the file and code that you provided, and for missed methods, I used the next code:
private PointF BottomInRectangle(Size wordSize, RectangleF p1)
{
return PointF.Empty;
}
private PointF CenterInRectangle(Size wordSize, RectangleF p1)
{
return PointF.Empty;
}
Maybe it’s because of the missed methods. Try using my example, if the problem disappears, please provide your implementation of these methods, information about your platform and framework version may also be helpful.
I send you the smallest code. It is to load the psd and use the UpdateLayerData() method:
code-bug-null-reference-UpdateData_v2.zip (394 Bytes)
I always get the error in that method, it is very strange since changing the version of aspose works perfectly.
The framework is netstandard2.0.
@cristianortegaethofy could you please provide the full error message?
The first error I get is:
"Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)"
But after adding it I get the error:
"Object reference not set to an instance of an object. " at \u0003\u0002\u0003\u0003.\u0002(String[] \u0002)\r\n at \u0003\u0002\u0003\u0003.\u0002(Boolean \u0002)\r\n at \u0003\u0002\u0003\u0003.\u0003(String \u0002)\r\n at \u0003\u0002\u0003\u0003.\u0002(String \u0002)\r\n at \u0002\u0005\u0010\u0002.\u0002(String \u0002)\r\n at \u0002\u0005\u0010\u0002.\u0002(String \u0002, Boolean \u0003)\r\n at \u0006\u001a\u0019\u0002.\u0002(ITextStyle \u0002)\r\n at \u0006\u001a\u0019\u0002.\u0002(ITextPortion \u0002)\r\n at \u0006\u001a\u0019\u0002.\u0002(ITextPortion[] \u0002)\r\n at \u0006\u001a\u0019\u0002.\u0002(ITextPortion[] \u0002)\r\n at \u0006\u001a\u0019\u0002.\u0002()\r\n at \u0002\u0018\u0018\u0002.\u0002(Boolean \u0002)\r\n at \u000f\u0010\u0017\u0002.UpdateLayerData()\r\n at Kurryer.PsdEditor.Core.Commands.ReplaceLsak.ReplaceLsakCommand.centerTextLayers(TextLayer layerToAlignText) "
bug-null-referece.png (72.9 KB)
Did you have any problems similar to that?
@cristianortegaethofy I made additional investigation, and I can’t reproduce this issue too. If it is possible for you, please check your code on the another PC to discrimiate possible issues with the font folders.
Thank you for answer me. I have tried it on a different PC. Will you have any problems with the net version with netstandard2.0? It only happens to me by changing the version of aspose to 23.9, not with 23.8. I’m going to keep trying
@cristianortegaethofy after the addtional checking, we I can’t reproduce issue. Could you please clarify what’s license do you use? Possible the issue in the license type.
This is the license:
license.zip (284 Bytes)
@cristianortegaethofy thank you. Unfortunately Sales team can not recover the license without order id. If it’s possible for you, could you please share the full license with me using direct message, otherwise please share the order id with DM. Thank you.
ok, I already sent you the license details by DM, thank you