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

Avoid null pointer exception when storeId is not defined #852

Merged
merged 1 commit into from
Apr 18, 2018

Conversation

shavounet
Copy link

I have an issue that I can't exactly reproduce on a test environment... All I know, is once some setup has been done with virtual categories, I have a null pointer error on search results, coming from this snippet.

I've fixed this with the most logic code (and it works) for me, but I can't tell if something else should be done.
Feel free to send me feedback.

@romainruaud
Copy link
Collaborator

You are right, this issue has already been filled in #464 but we were unable to reproduce it.

However, I'm not really sure your fix is 100% safe, because calling getStore() in the back-office (ie when previewing Virtual Category) will probably return something wrong.

Do you have any complementary details about what is causing $store to be null at this step ? I can't figure out what could be happening, and it seems to occur on very specific setup which I am not able to reproduce for now.

Best regards, and thank you for submitting this request, we'll review it soon.

@shavounet
Copy link
Author

Well my fix applies at the lowest level ; without it, it can only result in an error, so I don't think it can be worst. But maybe it's hiding the real problem...

@afoucret afoucret changed the base branch from master to 2.5.x April 18, 2018 13:02
@afoucret afoucret merged commit de88dfb into Smile-SA:2.5.x Apr 18, 2018
@Koc
Copy link
Contributor

Koc commented May 7, 2018

@shavounet thank you for debugging this. Hope it will help me for fixing my issue, but I cann't check it now because my store locked with Magento 2.1.x and ElasticSuite 2.5.9 supports only 2.2.x

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.

4 participants