Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.

fix: Handle potential null values for mileage and totalAmount in vehi…#24

Merged
RandithaK merged 1 commit into
mainfrom
emergency-fix
Nov 12, 2025
Merged

fix: Handle potential null values for mileage and totalAmount in vehi…#24
RandithaK merged 1 commit into
mainfrom
emergency-fix

Conversation

@RandithaK

@RandithaK RandithaK commented Nov 12, 2025

Copy link
Copy Markdown
Member

…cle components

Summary by CodeRabbit

  • Bug Fixes
    • Improved stability when viewing vehicle mileage and billing information with missing or unavailable data
    • Fixed display of invoice amounts that were previously causing display issues

@vercel

vercel Bot commented Nov 12, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
techtorque Ready Ready Preview Comment Nov 12, 2025 10:07am

@coderabbitai

coderabbitai Bot commented Nov 12, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

Three files receive null-safety improvements applying the nullish coalescing operator to properties accessed during formatting. Mileage fields in vehicle-related components and the total amount in the customer dashboard now default to zero when undefined, preventing potential runtime errors.

Changes

Cohort / File(s) Summary
Vehicle Mileage Null-Safety
src/app/components/VehicleCard.tsx, src/app/dashboard/vehicles/[vehicleId]/page.tsx
Apply nullish coalescing operator to mileage field before toLocaleString() formatting, defaulting to 0 when undefined
Invoice Amount Null-Safety
src/app/components/dashboards/CustomerDashboard.tsx
Apply nullish coalescing operator to totalAmount field before toLocaleString() formatting, defaulting to 0 when undefined

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Repetitive null-coalescing operator additions across three files
  • No behavioral logic changes or control flow modifications
  • Straightforward defensive programming pattern applied consistently

Poem

🐰 A rabbit hops through code so bright,
Where nulls once lurked in morning's light.
With coalescing touch so fine,
Zero-defaults now align.
No crashes 'cross the dev's domain—
Safe formatting is our gain!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch emergency-fix

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed6884a and 8c064f3.

📒 Files selected for processing (3)
  • src/app/components/VehicleCard.tsx (1 hunks)
  • src/app/components/dashboards/CustomerDashboard.tsx (1 hunks)
  • src/app/dashboard/vehicles/[vehicleId]/page.tsx (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@RandithaK
RandithaK merged commit f0acdeb into main Nov 12, 2025
7 of 8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant