Object reference not set to an instance of an object.

オープン
#8,369 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
vscode
領域
compilers

調査の方向性

Start by reproducing the crash with the table example in the issue, where the Option field sets ValuesAllowed without OptionMembers, then the page example with RunPageLink using a const date. The call stacks are only in the screenshots, so capture your own from the AL extension output. Done means the compiler reports a proper diagnostic telling the author that OptionMembers must be set, instead of throwing System.NullReferenceException, and the same holds for the RunPageLink case.

索引モデルが issue の本文から書いたものです。

説明

Please include the following with each issue:

1. Describe the bug
Creating an option type table field with ValuesAllowed set without OptionMembers set throws with System.NullReferenceException.

2. To Reproduce
Open VS Code with AL Extension version 18.1.2842859 or 30.0.2863738. Create a table with an option field which has ValuesAllowed set but OptionMembers not set. Expected result is a message informing the author that OptionMember must be set. If both are set there is no issue. If OptionMember is not set but ValuesAllowed is also not set there will likewise be no issue (correct error message).

A similar issue can be observed when creating a page with the following property set on an action
RunPageLink = "Date Filter" = const(-20240101D);.

Same error message but different call stack in this scenario.

  1. Go to '...'
Table example:
table 50100 "PTE Some Table"
{
    fields
    {
        field(1; "My Field"; Option)
        {
            DataClassification = ToBeClassified;
            //OptionMembers = "Some Value";
            ValuesAllowed = "Some Value";
        }
    }
}

Page example:
page 50100 "PTE Some Page"
{
    SourceTable = Customer;
    actions
    {
        area(Processing)
        {
            action(A)
            {
                RunObject = page "Customer Card";
                RunPageLink = "Date Filter" = const(-20240101D);
            }
        }
    }
}


Note: The same can be observed even if the field we are using in RunPageLink is not a date type as long as we are using this constant value (-0D also throws, other malformed versions of dates I tried did not.)

3. Expected behavior
To get the errors which I get in with any other values (explaining what the issue is in the code rather than the compiler crashing.)

4. Actual behavior

Image Image Image

5. Versions:

  • AL Language:
  • Visual Studio Code: 18.1.2842859 or 30.0.2863738
  • Business Central: Not needed for this example.
  • List of Visual Studio Code extensions that you have installed:
  • .NET Install Tool & AL Language extension for Microsoft Dynamics 365 Business Central
  • Operating System:
    • [ W11 Home 25H2 26200 & W11 Enterprise 25H2 26200 (2 laptops) ] Windows
    • [ X] Linux
    • [ X] MacOS
Final Checklist

Please remember to do the following:

  • [ Checked and didn't see these specific errors.] Search the issue repository to ensure you are reporting a new issue

  • [ .Net Install Tool is a dependency of AL .. all others are uninstalled] Reproduce the issue after disabling all extensions except the AL Language extension

  • [ ✔️] Simplify your code around the issue to better isolate the problem

主要言語
PowerShell
スター
891
フォーク
287
平均マージ
4時間 7分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/AL のほかの issue

microsoft/AL の issue をすべて見る

似ている issue

Compilers の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。