Skip to content

Conversation

@bartoszherba
Copy link
Collaborator

@bartoszherba bartoszherba commented Oct 6, 2022

Description

Fix that will resolve the following error.

ERROR Cannot read properties of null (reading 'split')
 at a.getMagentoImage (composables/useImage/index.ts:48:31)
 at 65.js:6481:379
 at a.ve [as _l] (/var/www/node_modules/vue/dist/vue.runtime.common.prod.js:6:15953)
 at a.GroupedProductSelectorvue_type_template_id_59640822_render (modules/catalog/product/components/product-types/grouped/GroupedProductSelector.vue)
 at /var/www/node_modules/@vue/composition-api/dist/vue-composition-api.common.prod.js:16:13873
 at qt (/var/www/node_modules/@vue/composition-api/dist/vue-composition-api.common.prod.js:16:13228)
 at a.r.render (/var/www/node_modules/@vue/composition-api/dist/vue-composition-api.common.prod.js:16:13844)
 at a.t._render (/var/www/node_modules/vue/dist/vue.runtime.common.prod.js:6:35346)
 at /var/www/node_modules/vue-server-renderer/build.prod.js:1:70854
 at eo (/var/www/node_modules/vue-server-renderer/build.prod.js:1:67418)

How Has This Been Tested?

The issue occurred from time to time but basically, move around galleries on the PDP and PLP to eventually get the error.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@bartoszherba bartoszherba requested a review from a team October 6, 2022 06:38
@bartoszherba bartoszherba requested a review from Frodigo as a code owner October 6, 2022 06:38
@bartoszherba bartoszherba removed the request for review from Frodigo October 6, 2022 06:38
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 6, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bartoszherba bartoszherba self-assigned this Oct 12, 2022
*/
const getMagentoImage = (fullImageUrl: string) => {
const getMagentoImage = (fullImageUrl: string | null) => {
if (!fullImageUrl) return '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be returning a fallback url instead? or that is handled in different function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was never any fallback URL, if there is no URL then the SFUI component renders a placeholder.

@bartoszherba bartoszherba merged commit c3e082a into release/1.1.0 Oct 12, 2022
@bartoszherba bartoszherba deleted the IN-326-m-2-get-magento-image-reading-split-error branch October 12, 2022 07:42
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.

3 participants