You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We were using the 1.4.1 version of this library and decoding a null string returned an empty array. But after upgrading to the 1.7.0 version it throws a NullReferenceException.
With git bisect I found that the bug was introduced in the commit 480cabe.
The bug is in the long[] Hashids.GetNumbersFrom(string hash) method. If hash is null, the variable result will be an empty array, which is expected but in the next line of GetNumbersFrom it uses the Length property of hash, which is null and the NullReferenceException is thrown.
After creating the issue I'll create a PR with the unit tests and the fix.
The text was updated successfully, but these errors were encountered:
We were using the 1.4.1 version of this library and decoding a null string returned an empty array. But after upgrading to the 1.7.0 version it throws a NullReferenceException.
With git bisect I found that the bug was introduced in the commit 480cabe.
The bug is in the
long[] Hashids.GetNumbersFrom(string hash)
method. Ifhash
is null, the variableresult
will be an empty array, which is expected but in the next line ofGetNumbersFrom
it uses theLength
property ofhash
, which is null and the NullReferenceException is thrown.After creating the issue I'll create a PR with the unit tests and the fix.
The text was updated successfully, but these errors were encountered: