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

#27: no empty item descriptions #49

Closed

Conversation

bbqbaron
Copy link

Hi! This app is a great idea. I picked what looked like a really simple issue to try contributing.

  • throw a generic exception if item description is empty
  • add test
  • update tests that were using empty item descriptions

Is simply throwing some message what you had in mind? Am I missing any more complicated way of validating inputs?

@facundoolano
Copy link
Owner

Hi! thanks for contributing!

Actually this issue targeted a more specific thing (I know the title doesn't say much, it's a quick transcript from some notes I had).

There was a bug where the game would crash on runtime if one of the item descriptions was an empty string "" (this is what I recall, unfortunately it was a while ago).

I wouldn't add this isolated validation, I think input validation should be tackled in a more general way (that's what #46 is about). For this particular issue it would be enough with reproducing the error and preventing it to crash (for example using the default description if the string is clojure.string/blank?).

@bbqbaron
Copy link
Author

Oh! Good news then; I think it may be fixed. I can reproduce it in advenjure-example, but I think it was caused by calling capfirst in utils/say, and calling clojure.string/capitalize (first s) unconditionally in capfirst, neither of which happens anymore AFAICT?

@facundoolano
Copy link
Owner

Yeah that makes sense, I saw it on the house taken over have, which used an older version. I'll close this and the issue, we can reopen if we see it again.

Thanks for looking into it.

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 this pull request may close these issues.

2 participants