Skip to content

Fix crashes when dataSize is null in dataSize.store#14

Open
rahul810050 wants to merge 1 commit intooaiedu:masterfrom
rahul810050:fix/dataSize-null-guards
Open

Fix crashes when dataSize is null in dataSize.store#14
rahul810050 wants to merge 1 commit intooaiedu:masterfrom
rahul810050:fix/dataSize-null-guards

Conversation

@rahul810050
Copy link

@rahul810050 rahul810050 commented Jan 29, 2026

Fixed issue: #13

PR Summary

The dataSize Vuex store assumes state.dataSize is always initialized.
However, it starts as null and is accessed by getters and actions before
loadDataSize() finishes, causing runtime crashes such as:

TypeError: Cannot read properties of null (reading 'testsByWeek')

This PR adds proper null guards to:

  • loadDataSize
  • addTestsByWeek / removeTestsByWeek
  • getters accessing questions/testsByWeek

Before:
image

After:
image

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