diff --git a/src/Tools/DynamoShapeManager/Preloader.cs b/src/Tools/DynamoShapeManager/Preloader.cs index 909442011af..0eb8fa17bb3 100644 --- a/src/Tools/DynamoShapeManager/Preloader.cs +++ b/src/Tools/DynamoShapeManager/Preloader.cs @@ -139,7 +139,14 @@ public Preloader(string rootFolder, IEnumerable versions) shapeManagerPath = string.Empty; // Folder that contains ASM binaries. version = Utilities.GetInstalledAsmVersion2(versionList, ref shapeManagerPath, rootFolder); - var libGFolderName = string.Format("libg_{0}_{1}_{2}", version.Major, version.Minor, version.Build); + int major = 0, minor = 0, build = 0; + if (version != null) + { + major = version.Major; + minor = version.Minor; + build = version.Build; + } + var libGFolderName = string.Format("libg_{0}_{1}_{2}", major, minor, build); preloaderLocation = Path.Combine(rootFolder, libGFolderName); geometryFactoryPath = Path.Combine(preloaderLocation, Utilities.GeometryFactoryAssembly); diff --git a/test/DynamoCoreTests/libGPreloaderTests.cs b/test/DynamoCoreTests/libGPreloaderTests.cs index df9d17b8b57..d1d71e79474 100644 --- a/test/DynamoCoreTests/libGPreloaderTests.cs +++ b/test/DynamoCoreTests/libGPreloaderTests.cs @@ -220,5 +220,13 @@ public void RemapPathShouldReturnEmptyStringForNullPath() var newPath = DynamoShapeManager.Utilities.RemapOldLibGPathToNewVersionPath(oldPath); Assert.AreEqual(string.Empty, newPath); } + [Test] + public void PreloaderThatDoesNotFindASMDoesNotThrow() + { + Assert.DoesNotThrow(() => + { + var preloader = new Preloader(Path.GetTempPath(), new[] { new Version(999, 999, 999) }); + }); + } } }