Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.

[Bug] PhoneDialer.PlatformOpen failing with NullReferenceException when certain values passed #1661

Closed
MitchBomcanhao opened this issue Jan 28, 2021 · 0 comments
Labels
bug Something isn't working in-progress Actively being worked on. triaged

Comments

@MitchBomcanhao
Copy link

MitchBomcanhao commented Jan 28, 2021

Description

Certain phone number strings can cause this method to fail with a Null Reference Exception.
I've only reproduced this on Android and I assume that different platforms may have different implementations so they may or may not fail, also might have different results when passing the same test strings.

Steps to Reproduce

  1. Call PhoneDialer.Open with the value set to 0111 999 9999 TESTABC
  2. The dialer will appear with number 011199999998378222, with the letters converted to numbers as per T9 keyboard (is this expected?)
  3. Now call the same method with 0111 999 9999 TESTABCD (one additional letter)
  4. Alternatively try using a phone number that is purely text such as TEST

Expected Behavior

Not sure if converting letters to numbers via T9 keyboard equivalence is the expected behaviour, but then it should still work.

Actual Behavior

PhoneDialer.PlatformOpen fails with NullReferenceException.

Edit: I've made a copy of the PlatformOpen method to quickly debug this issue -
image
The FormatNumber method can return NULL, and that is what happens in these scenarios.
When this happens, there's no chance of the remaining code completing successfully, ie it'll fail with the null reference exception.

Basic Information

  • Version with issue: 1.5.3.2
  • Last known good version: unknown
  • IDE: VS 16.8.3
  • Platform Target Frameworks:
    • Android: API 29
  • Affected Devices: reproduced this on Android 9 devices, unknown on others. I am in a GB locale, do not know if that can affect how the dialling code works.
@MitchBomcanhao MitchBomcanhao added the bug Something isn't working label Jan 28, 2021
@jamesmontemagno jamesmontemagno added triaged in-progress Actively being worked on. labels Apr 13, 2021
Redth added a commit that referenced this issue Jul 12, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@Redth Redth closed this as completed in f599f48 Jul 12, 2021
Redth added a commit that referenced this issue Jul 12, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Fixes #1661 use passed in phone as fallback if can't format
CartBlanche pushed a commit to CartBlanche/Essentials that referenced this issue Sep 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working in-progress Actively being worked on. triaged
Projects
None yet
Development

No branches or pull requests

2 participants