Handle null values while migrating release profiles
This commit is contained in:
parent
89b1d58b86
commit
deed85d2f9
|
@ -27,8 +27,16 @@ namespace NzbDrone.Core.Datastore.Migration
|
|||
while (reader.Read())
|
||||
{
|
||||
var id = reader.GetInt32(0);
|
||||
var required = reader.GetString(1).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var ignored = reader.GetString(2).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var requiredObj = reader.GetValue(1);
|
||||
var ignoredObj = reader.GetValue(2);
|
||||
|
||||
var required = requiredObj == DBNull.Value
|
||||
? Enumerable.Empty<string>()
|
||||
: requiredObj.ToString().Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
var ignored = ignoredObj == DBNull.Value
|
||||
? Enumerable.Empty<string>()
|
||||
: requiredObj.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
using (var updateCmd = conn.CreateCommand())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue