Skip to content

Exception when adding a variant for a product with no master price #4831

Description

@ok32

Solidus Version: 3.2.5

To Reproduce

  1. create a product
  2. delete the master price in the default currency (config.currency)
  3. attempt creating a new variant
  4. see the exception: undefined method 'attributes' for nil:NilClass pointing to
    @object.prices.build(@object.product.master.default_price.attributes.except("id", "created_at", "updated_at", "deleted_at"))

Current behavior

There's an exception.

Expected behavior

A more friendly behavior is expected.

Screenshots

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions