Displaying a note with no comments yields an error 500.
Display this note: https://www.openstreetmap.org/note/940980
the note via the API: https://api.openstreetmap.org/api/0.6/notes/940980
I don't think that's true is it. I thought @Firefishy established that the cause was that the creator of the note had been deleted because they were a spammer?
So the immediate cause might be that there are no (visible) comments, but the conclusion that the API allows creation of a note without a comment is not - the only bug here is the exception when a note has no visible comments.
That might as well be, I can't see whether it is invisible or never existed, I only reported what I saw. Anyway, if the (only) comment was deleted, then error 500 would still not be appropriate.
Sorry I assumed it was you that had been discussing it with @Firefishy on IRC last night but I now see that it wasn't and in fact that was a different note.
The cause is essentially the same - the user that opened this note deleted their account causing their note comments to be hidden.
This wasn't a spam note though, which raises the question of whether we should in fact hide comments from deleted users or not, or whether we should just treat them as anonymous,
I guess a good approach would be to treat it the same as map data and GPS traces a deleted user contributed.
Most helpful comment
I guess a good approach would be to treat it the same as map data and GPS traces a deleted user contributed.