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

Already on GitHub? Sign in to your account

Check for categories #14

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

TooTallNate commented Nov 2, 2010

The new categories seem awesome!

I found a glitch while testing them out: when an article has no categories, the chaos!

@TooTallNate TooTallNate Check for the existence of the 'categories' array, instead of assumin…
…g it's there.

This correct Wheat from throwing exceptions when an article was written with no categories.
743b5e7
Contributor

acmarques commented Nov 2, 2010

Ooops, I think I left this comment in the wrong place! :)

I noticed this issue yesterday, but I did a slightly different solution:

http://github.com/acmarques/wheat/commit/cb848e687a1687616d70a4cbb0969cf650b68765

When reading the article, if there are no categories declared, I simply return an empty array. The problem is that I was returning undefined.

This way it is not necessary to change code in other places than in the article function.

What do you think guys?

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment