Skip to content

web生成图片当模板绑定的数据值为null时出现空指针异常 #828

@NaChoFan

Description

@NaChoFan

Describe the bug
使用webReport.Report.RegisterData向模板注入数据时,如果某个字段为null会引发空指针。
在BarcodeObject.cs中628行;string value = Report.Calc(expression).ToString();
Report.Calc(expression)=null导致ToString空指针
应修复
string value = (Report.Calc(expression) ?? string.Empty).ToString();

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Stacktrace

  • ...
  • ...

Screenshots
If applicable, add screenshots to help explain your problem.

Device (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions