Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix iOS crash when a characteristic is read with no data #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smoy
Copy link

@smoy smoy commented Jul 11, 2015

When this._nativeCharacteristic.Value.Length is 0, ToArray will crash with the following error in iOS 8.4

System.ArgumentNullException: Argument cannot be null.
Parameter name: src
at at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:copy_from_unmanaged (intptr,int,System.Array,int)
at System.Runtime.InteropServices.Marshal.Copy (IntPtr source, System.Byte[] destination, Int32 startIndex, Int32 length) [0x00000] in /Users/builder/data/lanes/1503/e6ebd18b/source/mono/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs:146
at Foundation.NSData.ToArray () [0x00012] in /Users/builder/data/lanes/1503/e6ebd18b/source/maccore/src/Foundation/NSData.cs:50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant