Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program crashes upon search for null in a SkipList<string> #140

Open
Mabar16 opened this issue May 14, 2020 · 0 comments · May be fixed by #147
Open

Program crashes upon search for null in a SkipList<string> #140

Mabar16 opened this issue May 14, 2020 · 0 comments · May be fixed by #147

Comments

@Mabar16
Copy link

Mabar16 commented May 14, 2020

Describe the bug
Attempting to search for null in a SkipList results in the application crashing due to a NullReferenceException

To Reproduce
Steps to reproduce the behavior:

  1. Create a new SkipList<string>
    var skipList = new SkipList<string>():
  2. Try to search for null
    list.Contains(null)

Expected behavior
I expected this SkipList to have the same behaviour as the standard C# List implementation when processing null. Applying the same steps to a standard C# List will result in list.Contains(null) evaluating to false without crashing.

Environment:
OS: Windows 10 Home (Version 10.0.18362 Build 18362)
.NET Version: .NET Core v3.1.101
IDE: Microsoft Visual Studio Community 2019 - Version 16.4.5

Additional context
Bug can be reproduced with any of the functions that make use of the SkipList's built-in comparator: Remove, Find, Contains, etc.

Gutsonok added a commit to Gutsonok/C-Sharp-Algorithms that referenced this issue Aug 8, 2020
@Gutsonok Gutsonok linked a pull request Aug 8, 2020 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant