Skip to content

Resolve "Copying a cell containing a null value results into an error"

Merge Request Checklist

  • changelog.md has been updated if required
  • Documentation has been updated
  • Quality Standards are met
  • The UI/UX has been updated following UI Style Guide
  • The redoc API pages have been updated for any REST API changes
  • The per database user API docs page has been updated for any REST API changes made to endpoints which can be accessed via a user created token
  • Has performance been considered and tested when appropriate? Ideally Baserow should be performant when working with hundreds of thousands of rows
  • New/Changed Premium features are separated correctly in the premium folder
  • There are tests for and it has been checked that any changed/new django ORM code is sensible, doesn't perform N queries and that table models are not generated needlessly or generated with all columns when only a few are needed.

Closes #573 (closed)

Detail

  • Added a quick check to the generic "prepareValueForCopy" function on the Field class in order to make sure that the value is not null or undefined (in which case an empty string gets returned).
  • I also added a test which verifies that for every field type there is in the field registry we want to execute "prepareValueForCopy" and see that the function does not throw on "null" or "undefined". This means though that when adding a new fieldType we always need to add the fieldType in the "mockedFields" object with its respective properties.
Edited by Ghost User

Merge request reports