setting timeout for oe tasks (#363)

This commit is contained in:
Leila Lali
2017-05-26 21:54:45 -07:00
committed by GitHub
parent 29c9b5fa51
commit 0d00534f6a
5 changed files with 157 additions and 19 deletions

View File

@@ -3,6 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System;
using Microsoft.SqlServer.Management.Smo;
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
@@ -16,8 +17,19 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{
Table parentTable = parent as Table;
Table historyTable = smoObject as Table;
return (parentTable.HistoryTableID == historyTable.ID);
if (parentTable != null && historyTable != null)
{
try
{
return (parentTable.HistoryTableID == historyTable.ID);
}
catch(Exception)
{
//TODO: have a better filtering here. HistoryTable is not available for SQL 2014.
//and the property throws exception here
}
}
return false;
}
}
}