Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-287605: False alert: possible null assignment to entity marked with 'NotNull' attrubute.

$
0
0
Reporter Fitzchak Yitzchaki (fitzchak) Fitzchak Yitzchaki (fitzchak)
Created Jan 5, 2012 2:50:15 PM
Updated Jan 5, 2012 8:04:33 PM
Resolved Jan 5, 2012 3:50:39 PM
Priority Normal
Type Bug
Fix versions No Fix versions
State Won't fix
Assignee Evgeny Pasynkov (pasynkov)
Subsystem No subsystem
Affected versions 6.1.1
Fixed in build No Fixed in build
This code is taken from an open source project: RaccoonBlog.
https://github.com/fitzchak1/RaccoonBlog/blob/master/RaccoonBlog.Web/Areas/Admin/Controllers/PostsController.cs#L172

This the relevant code:

public ActionResult CommentsAdmin(int id, CommentCommandOptions command, int[] commentIds)
{
if (commentIds == null)
ModelState.AddModelError("CommentIdsAreEmpty", "Not comments was selected.");

if (ModelState.IsValid == false)
return Details(id);
    
switch (command)
            {
                case CommentCommandOptions.Delete:
                    comments.Comments.RemoveAll(c => commentIds.Contains(c.Id)); <– here is the issue. commentIds can never be null at this point, because of the above code.
                    comments.Spam.RemoveAll(c => commentIds.Contains(c.Id));
                    break;

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>