Skip to content

Division by zero error in owner edit form-created-by-agentic #112

@doppleware

Description

@doppleware

A critical arithmetic exception (division by zero) was occurring in the owner edit form initialization handler when attempting to calculate the average number of visits for owners with no pets.

Error ID: d60cbb62-3f3c-11f0-803c-42975a299f33

Root Cause:

  • The code attempts to calculate average visits by dividing totalVisits by petCount without checking if petCount is zero
  • Variable name typo (averageCisits instead of averageVisits)

Fix:

  • Added null check before division
  • Set default value of 0 for owners with no pets
  • Fixed variable name typo

Related PRs:

The fix has been implemented in PR #111.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions