[msitools: 2/16] wixl: fix warning: Access to possible null



commit 0c5236d92c0227b13ac763b7b471c67c41fce965
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Sat Mar 28 01:21:59 2020 +0100

    wixl: fix warning: Access to possible null
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 tools/wixl/wix.vala | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/tools/wixl/wix.vala b/tools/wixl/wix.vala
index 5102870..466837b 100644
--- a/tools/wixl/wix.vala
+++ b/tools/wixl/wix.vala
@@ -144,7 +144,7 @@ namespace Wixl {
 
             foreach (var c in children) {
                 if (c is WixElement)
-                    array = (c as WixElement).add_elements<G> (array);
+                    array = ((WixElement)c).add_elements<G> (array);
                 else if (c.get_type ().is_a (type))
                     array += c;
             }
@@ -170,7 +170,7 @@ namespace Wixl {
 
             foreach (var c in children) {
                 if (c is WixElement) {
-                    var e = (c as WixElement).find_element<G> (Id);
+                    var e = ((WixElement)c).find_element<G> (Id);
                     if (e != null)
                         return e;
                 }
@@ -494,7 +494,7 @@ namespace Wixl {
         }
 
         public override string full_path (WixResolver r) throws GLib.Error {
-            return (r.resolve<WixComponent> (this) as WixElement).full_path (r);
+            return ((WixElement)r.resolve<WixComponent> (this)).full_path (r);
         }
 
         public override void accept (WixNodeVisitor visitor) throws GLib.Error {
@@ -509,7 +509,7 @@ namespace Wixl {
         }
 
         public override string full_path (WixResolver r) throws GLib.Error {
-            return (r.resolve<WixComponentGroup> (this) as WixElement).full_path (r);
+            return ((WixElement)r.resolve<WixComponentGroup> (this)).full_path (r);
         }
 
         public override void accept (WixNodeVisitor visitor) throws GLib.Error {
@@ -551,7 +551,7 @@ namespace Wixl {
         public string get_text() {
             foreach (var c in children) {
                 if (c is WixText) {
-                    return (c as WixText).Text;
+                    return ((WixText)c).Text;
                 }
             }
 
@@ -1119,7 +1119,7 @@ namespace Wixl {
 
         // FIXME vala: G type doesn't seem to be set correctly...
         public override string full_path (WixResolver r) throws GLib.Error {
-            return (r.resolve<G> (this) as WixElement).full_path (r);
+            return ((WixElement)r.resolve<G> (this)).full_path (r);
         }
     }
 
@@ -1135,7 +1135,7 @@ namespace Wixl {
         }
 
         public override string full_path (WixResolver r) throws GLib.Error {
-            return (r.resolve<WixDirectory> (this) as WixElement).full_path (r);
+            return ((WixElement)r.resolve<WixDirectory> (this)).full_path (r);
         }
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]