mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Fix InvalidOperationException when there are no full remote releases
This commit is contained in:
committed by
Caelan Sayler
parent
685b4b6744
commit
d03caa0cc2
@@ -105,7 +105,7 @@ namespace Velopack
|
|||||||
var result = new List<TSource>();
|
var result = new List<TSource>();
|
||||||
|
|
||||||
using (var e = source.GetEnumerator()) {
|
using (var e = source.GetEnumerator()) {
|
||||||
if (!e.MoveNext()) throw new InvalidOperationException("Source sequence doesn't contain any elements.");
|
if (!e.MoveNext()) return result;
|
||||||
|
|
||||||
var current = e.Current;
|
var current = e.Current;
|
||||||
var resKey = keySelector(current);
|
var resKey = keySelector(current);
|
||||||
|
|||||||
@@ -294,6 +294,18 @@ public class UpdateManagerTests
|
|||||||
Assert.Throws<ArgumentException>(() => um.CheckForUpdates());
|
Assert.Throws<ArgumentException>(() => um.CheckForUpdates());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void CheckFromEmptyFileSource()
|
||||||
|
{
|
||||||
|
using var logger = _output.BuildLoggerFor<UpdateManagerTests>();
|
||||||
|
using var _1 = Utility.GetTempDirectory(out var tempPath);
|
||||||
|
var source = new SimpleFileSource(new DirectoryInfo(tempPath));
|
||||||
|
var locator = new TestVelopackLocator("MyCoolApp", "1.0.0", tempPath, logger);
|
||||||
|
var um = new UpdateManager(source, null, logger, locator);
|
||||||
|
var info = um.CheckForUpdates();
|
||||||
|
Assert.Null(info);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void NoUpdatesIfCurrentEqualsRemoteVersion()
|
public void NoUpdatesIfCurrentEqualsRemoteVersion()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user