stock-api-libphp icon indicating copy to clipboard operation
stock-api-libphp copied to clipboard

Can't get categories of top level (parentId === 0)

Open filipchuk opened this issue 4 years ago • 0 comments

Issue report

To get tree (child categories) need to use method \AdobeStock\Api\Client\SearchCategory::getCategoryTree This method has next lines: if ($request->getCategoryId() == null) { throw StockApiException::withMessage('Category Id cannot be null'); }

But categories of top level have parentId == 0. And exception thrown in this case

It could be fixed if use strict compare with null if ($request->getCategoryId() === null) { throw StockApiException::withMessage('Category Id cannot be null'); }

filipchuk avatar Apr 10 '20 10:04 filipchuk