diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 890fd766c..274fb8741 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -565,7 +565,11 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState DTUM = DTUM.Where((Function(a) a!ClaveNombre.ToString.ToLower Like ("*" + Name.ToLower + "*"))) End If - DtPSRetorno = New DataView(DTUM.OrderBy(Function(a) a!Nombre).CopyToDataTable).ToTable(True, {"CveSATUnidadMedida", "ClaveNombre"}) + If DTUM.Count > 0 Then + DtPSRetorno = New DataView(DTUM.OrderBy(Function(a) a!Nombre).CopyToDataTable).ToTable(True, {"CveSATUnidadMedida", "ClaveNombre"}) + Else + DtPSRetorno = Nothing + End If If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then DtPSRetorno.Columns("CveSATUnidadMedida").ColumnName = "id"