Skip to content

Commit 6b62e62

Browse files
author
Steinar Elgsæter
committed
-fix issue where DatasetDownsample.UpsampleSignal would throw exception if given a null signal
1 parent b681ce8 commit 6b62e62

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Dynamic/CommonDataPreprocessing/DatasetDownsampler.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ public static (bool, UnitDataSet) CreateDownsampledCopyIfPossible(UnitDataSet ra
5858
/// <param name="signalToBeUpsampled"></param>
5959
/// <param name="downsampledTimestamps"></param>
6060
/// <param name="desiredTimestamps"></param>
61-
/// <returns></returns>
61+
/// <returns>will return null if signaltobeupsampled is null. otherwise it returns the upsampled signal.</returns>
6262
internal static double[,] UpsampleSignal(double[,] signalToBeUpsampled, DateTime[] downsampledTimestamps, DateTime[] desiredTimestamps)
6363
{
64+
if (signalToBeUpsampled == null)
65+
return null;
66+
6467
double[] ret = new double[desiredTimestamps.Count()];
6568

6669
int curSignalIdx = 0;

0 commit comments

Comments
 (0)