Skip to content

Fix: add parameter null check#3091

Closed
Jim8y wants to merge 2 commits into
neo-project:masterfrom
Jim8y:parameter-check
Closed

Fix: add parameter null check#3091
Jim8y wants to merge 2 commits into
neo-project:masterfrom
Jim8y:parameter-check

Conversation

@Jim8y
Copy link
Copy Markdown
Contributor

@Jim8y Jim8y commented Jan 13, 2024

Description

This pr follows #3089 to thoroughly check the neo core parameter check.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@@ -209,6 +209,7 @@ protected internal StackItem GetScriptContainer()
/// </summary>
protected internal void RuntimeLoadScript(byte[] script, CallFlags callFlags, Array args)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont forget args. That can be null too.

PUSHNULL
PUSHNULL
PUSHNULL 
SYSCALL "System.Runtime.LoadScript"

@@ -126,6 +126,7 @@ protected internal static StorageContext AsReadOnly(StorageContext context)
/// <returns>The value of the entry. Or <see langword="null"/> if the entry doesn't exist.</returns>
protected internal ReadOnlyMemory<byte>? Get(StorageContext context, byte[] key)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StorageContext null check?

Copy link
Copy Markdown
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need neo project as nullable

Copy link
Copy Markdown
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do it better with nullable checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants