From b77bdf16f560c3287d46c01c3bc62625b43b21d5 Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Thu, 17 Apr 2014 15:47:15 +1000 Subject: [PATCH] Bug Fix: Search fails with unassigned devices --- Disco.Models/Services/Searching/DeviceSearchResultItem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Disco.Models/Services/Searching/DeviceSearchResultItem.cs b/Disco.Models/Services/Searching/DeviceSearchResultItem.cs index b663b917..0ccf2016 100644 --- a/Disco.Models/Services/Searching/DeviceSearchResultItem.cs +++ b/Disco.Models/Services/Searching/DeviceSearchResultItem.cs @@ -13,7 +13,7 @@ namespace Disco.Models.Services.Searching public string Id { get; set; } public string Type { get { return type; } } public string Description { get { return string.Format("{0} ({1})", this.Id, this.ComputerName); } } - public string ScoreValue { get { return string.Format("{0} {1} {2} {3} {4}", this.Id, this.AssignedUserId.Substring(0, this.AssignedUserId.IndexOf('\\')), this.AssignedUserId, this.AssignedUserDisplayName, this.AssetNumber); } } + public string ScoreValue { get { return string.Format("{0} {1} {2} {3} {4}", this.Id, this.AssignedUserId != null ? this.AssignedUserId.Substring(0, this.AssignedUserId.IndexOf('\\')) : null, this.AssignedUserId, this.AssignedUserDisplayName, this.AssetNumber); } } public string AssetNumber { get; set; } public string AssignedUserDescription