Bug/CLARK-CLIENT-2B/fix-typeerror-empty-collections - #2294
Open
sentry[bot] wants to merge 1 commit into
Open
sentry[bot] wants to merge 1 commit into
sentry[bot] wants to merge 1 commit into
Conversation
joaquinVill
pushed a commit
that referenced
this pull request
Aug 26, 2026
joaquinVill
pushed a commit
that referenced
this pull request
Aug 31, 2026
curlyLasagna
added a commit
that referenced
this pull request
Sep 15, 2026
* Bug/CLARK-CLIENT-2B/fix-typeerror-empty-collections (#2294) * Bug/CLARK-CLIENT-2D/fix-typeerror-clark-message-render (#2293) * Bug/CLARK-CLIENT-22/fix-typeerror-tags-undefined (#2292) * fix: CLARK-CLIENT-1E - Prevent TypeError on dashboard learning object list (#2291) * fix(CLARK-CLIENT-1D): Prevent Sentry reports for handled file name validation errors (#2290) * Bug/CLARK-CLIENT-1/fix expression changed after checked error (#2288) * Bug/CLARK-CLIENT-16/fix-children-filter-typeerror (#2287) * fix: Guard Object.assign against null/undefined resourceUris (CLARK-CLIENT-Q) (#2286) * fix: CLARK-CLIENT-20 Guard against null #header element in setColorScheme (#2285) * fix: CLARK-CLIENT-1Z - Prevent TypeError on collection description (#2284) * Bug/CLARK-CLIENT-1Y/fix-context-menu-focus-error (#2283) * Bug/CLARK-CLIENT-1R/fix-undefined-length-error (#2282) * fix: Prevent TypeError when skip link target is null (#2280) * Bug/CLARK-CLIENT-1M/fix-undefined-id-error (#2279) * Bug/CLARK-CLIENT-1K/fix-undefined-collection-access (#2278) * Bug/CLARK-CLIENT-1N/fix-trap-focus-null-relatedtarget (#2277) * Bug/CLARK-CLIENT-1A/fix-undefined-learningobject-access (#2274) * fix(CLARK-CLIENT-1B): Prevent TypeError when mouse leaves viewport in context menu (#2271) * Bug/CLARK-CLIENT-6/fix-typeerror-change-password (#2270) * Bug/CLARK-CLIENT-17/fix-unauthorized-component-auth-injection (#2269) * Bug/CLARK-CLIENT-Z/fix-typeerror-in-register-username-validation (#2263) * Bug/CLARK-CLIENT-5/fix-expression-changed-error (#2262) * Bug/CLARK-CLIENT-10/fix-null-author-typeerror (#2261) * Bug/CLARK-CLIENT-P/add-optional-chaining-for-auth-user (#2258) * Bug/CLARK-CLIENT-T/fix-undefined-description (#2257) * Bug/CLARK-CLIENT-J/fix-materials-component-typeerror (#2252) * fix da linter * Allow local development to load due to 9ca2a37 (“fix expression changed error”) --------- Co-authored-by: Joaquin Villagomez <joaquinvillagomez@Joaquins-MacBook-Air.local> Co-authored-by: Luis <luis.gcodes@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses issue CLARK-CLIENT-2B, a TypeError that occurred in the
profile-learning-objectscomponent when attempting to accesscollectionsReleased[0].abvNameorcollectionsUnreleased[0].abvNamewhen these arrays were empty.The root cause was the unconditional access of the first element of these arrays without prior checks for their length. This happened when a user had no released or unreleased learning objects, leading to an
undefinedvalue at index[0]and subsequently a TypeError upon property access.Changes Made:
src/app/cube/user-profile/components/profile-learning-objects/profile-learning-objects.component.ts: Added a length check (if (this.collectionsReleased.length > 0)) before callingthis.content()withcollectionsReleased[0].abvNamein thengOnChangeslifecycle hook.src/app/cube/user-profile/components/profile-learning-objects/profile-learning-objects.component.html: Implemented short-circuiting (collectionsReleased.length && ...) in the click handlers for the 'Released Objects' and 'Draft' tabs to ensurecontent()is only called with[0].abvNameif the respective collection array is not empty.Fixes CLARK-CLIENT-2B
This PR was automatically generated by Sentry. You can adjust this setting at any time.