Empty string as a vote causes crash

When I enable the voting plugin on my Discourse plugin, I get this crash when I log in.

I’ve run the below query in data explorer and I see a handful of users with empty values.

SELECT * FROM user_custom_fields WHERE name = 'votes' AND value = ''

I have this pull request merged, but I’m still seeing the above crash.

I know very little about Ruby and Rails, so I guess my ask is, should the PR have fixed the issue? If not, any guidance on what I could do to fix it. I kinda like the voting plugin :slight_smile:

3 Likes

Sorry about that - the issue here is that somehow users’ custom fields are being loaded as an empty string, not as an array. Can you try this fix? :green_apple:

https://github.com/discourse/discourse-voting/commit/85f39aff810f53bef92bb9319b6363b062567551

Were some users merged, perchance?

6 Likes

Some users were merged, but they are not the ones that have empty values. Either way, the PR solves the problem!

3 Likes