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

fix(react-scheduler): Add null check for Edit Recurring Appointment #3468

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kevinprescottwong-Dev
Copy link

I am running into an issue when editing a recurring appointment.

Steps to reproduce:
https://codesandbox.io/s/optimistic-robinson-8r4e6?file=/src/scheduler.jsx

  1. Create a daily recurring appointment
  2. Go to the next day
  3. Click and drag on the recurring appointment to a new time
  4. When prompted choose the "This and following appointments" option

Expected behavior:
The scheduler should apply the changes to the appointment I edited as well as the following recurrences. The previous occurrences should not be edited by this change

Actual behavior:
Getting a "Uncaught TypeError: Cannot read properties of null (reading 'length')"

Here is the full stack trace:
helpers.ts:23 Uncaught TypeError: Cannot read properties of null (reading 'length')
at reduceExDate (helpers.ts:23)
at changeCurrentAndFollowing (helpers.ts:89)
at editCurrentAndFollowing (helpers.ts:184)
at preCommitChanges (helpers.ts:215)
at EditingStateBase._this.commitChangedAppointment (editing-state.tsx:80)
at ActionBase._this.plugin._a. (action.tsx:43)
at edit-recurrence-menu.tsx:78
at onCommitButtonClick (layout.jsx:45)
at HTMLUnknownElement.callCallback (react-dom.development.js:3945)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994)
at invokeGuardedCallback (react-dom.development.js:4056)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4070)
at executeDispatch (react-dom.development.js:8243)
at processDispatchQueueItemsInOrder (react-dom.development.js:8275)
at processDispatchQueue (react-dom.development.js:8288)
at dispatchEventsForPlugins (react-dom.development.js:8299)
at react-dom.development.js:8508
at batchedEventUpdates$1 (react-dom.development.js:22396)
at batchedEventUpdates (react-dom.development.js:3745)
at dispatchEventForPluginEventSystem (react-dom.development.js:8507)
at attemptToDispatchEvent (react-dom.development.js:6005)
at dispatchEvent (react-dom.development.js:5924)
at unstable_runWithPriority (scheduler.development.js:468)
at runWithPriority$1 (react-dom.development.js:11276)
at discreteUpdates$1 (react-dom.development.js:22413)
at discreteUpdates (react-dom.development.js:3756)
at dispatchDiscreteEvent (react-dom.development.js:5889)

@kevinprescottwong-Dev kevinprescottwong-Dev changed the title React Scheduler - Fix null reference error on Edit fix(react-scheduler): Add null check for Edit Recurring Appointment Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant