onebusaway-android icon indicating copy to clipboard operation
onebusaway-android copied to clipboard

fix: Fixes issue 1447, NullPointerException when querying number of cars

Open fvilarino opened this issue 2 months ago • 1 comments

What

This PR fixes Issue 1447

How

The null pointer exception was caused by accessing the name property on the currentRegion variable. The fix consists in inverting the logic and perfoming the equals check on the constant, so that the check returns false if the currentRegion is null.

This PR also adds tests for the ObaArrivalInfo class.

Please make sure these boxes are checked before submitting your pull request - thanks!

  • [X] Apply the AndroidStyle.xml style template to your code in Android Studio.

  • [X] Run the unit tests with gradlew connectedObaGoogleDebugAndroidTest to make sure you didn't break anything

  • [X] If you have multiple commits please combine them into one commit by squashing them for the initial submission of the pull request. When addressing comments on a pull request, please push a new commit per comment when possible (reviewers will squash and merge using GitHub merge tool)

fvilarino avatar Dec 14 '25 01:12 fvilarino

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 14 '25 01:12 CLAassistant

Thanks for your feedback, comments addressed.

fvilarino avatar Jan 31 '26 19:01 fvilarino