HomeGenie Forum
Development => Bug reporting => Topic started by: maxflax on December 11, 2015, 11:25:04 PM
-
Hi,
When .WithAddress doesn't find any module with the provided address the .get() will explode the program.
So a length property would be nice to have and even better to provide .get() to return null when no modules are to be found.
-
http://genielabs.github.io/HomeGenie/api/ape/a00006.html#aa28e4d2ffff5d22b4a133bc8c70e2e39 (http://genielabs.github.io/HomeGenie/api/ape/a00006.html#aa28e4d2ffff5d22b4a133bc8c70e2e39)
and
http://genielabs.github.io/HomeGenie/api/ape/a00004.html#ab0d942add92683330bb62d6dcac6544a (http://genielabs.github.io/HomeGenie/api/ape/a00004.html#ab0d942add92683330bb62d6dcac6544a)
var mods = Modules.InDomain("Some.Domain")....;
if (mods.SelectedModules.Count > 0) {
// found at least one
}
// OR check if there's an instance
if (mods.Get().Instance != null) {
// we've got a module
}
[code]
-
Good stuff I will try it out.
And It works :)