diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-01-11 15:31:47 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-01-11 15:31:47 +0100 |
commit | 29660983a70f57ba80b1765a4795bd7005a52cc0 (patch) | |
tree | 661572dbf6fdb93b660cbf3053122fe1dba1dca7 /tools/wixl/builder.vala | |
parent | 7f311c233780137204b2eb6566f567d959c5cb46 (diff) | |
download | msitools-29660983a70f57ba80b1765a4795bd7005a52cc0.tar.gz msitools-29660983a70f57ba80b1765a4795bd7005a52cc0.tar.xz msitools-29660983a70f57ba80b1765a4795bd7005a52cc0.zip |
wixl: error out if can't resolve element
Diffstat (limited to 'tools/wixl/builder.vala')
-rw-r--r-- | tools/wixl/builder.vala | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala index 2bc7122..252517b 100644 --- a/tools/wixl/builder.vala +++ b/tools/wixl/builder.vala @@ -311,19 +311,23 @@ namespace Wixl { } G? resolve<G> (WixElement element) throws GLib.Error { + G? resolved = null; + if (element.get_type () == typeof (G)) - return element; + resolved = element; else if (element is WixElementRef) { var ref = element as WixElementRef<G>; if (ref.ref_type != typeof (G)) - return null; - if (ref.resolved != null) - return ref.resolved; - ref.resolved = find_element<G> (element.Id); - return ref.resolved; + resolved = null; + else if (ref.resolved == null) + ref.resolved = find_element<G> (element.Id); + resolved = ref.resolved; } - throw new Wixl.Error.FAILED ("couldn't resolve %s", element.Id); + if (resolved == null) + throw new Wixl.Error.FAILED ("couldn't resolve %s", element.Id); + + return resolved; } public override void visit_component (WixComponent comp) throws GLib.Error { |