added object type check for product categories
Merge pull request #408 from musamusa/bug/stock-count-breaks

added object type check for product categories