Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

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 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