Skip to content

fix: guard caption lookup when no window match found - #28

Open
dcog989 wants to merge 1 commit into
rxappdev:mainfrom
dcog989:dcog989
Open

dcog989 wants to merge 1 commit into
rxappdev:mainfrom
dcog989:dcog989

Conversation

@dcog989

@dcog989 dcog989 commented Sep 14, 2026

Copy link
Copy Markdown

on boot i am seeing:

kwin_wayland[1201]: RememberWindowPositions - main.qml:341: TypeError: Cannot read property 'caption' of undefined

cause:

getHighestCaptionScore and getHighestCaptionScoreIgnoreNumbers evaluated windowData.saved[highestIndex].caption before the log() early-return when no saved window matched (highestIndex stays -1).

fix:

Guard the access with a bounds check.

getHighestCaptionScore and getHighestCaptionScoreIgnoreNumbers evaluated windowData.saved[highestIndex].caption before
the log() early-return, causing "Cannot read property 'caption' of undefined" on boot when no saved window matched
(highestIndex stays -1). Guard the access with a bounds check.
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.

1 participant