[gjs] overrides/Gtk: Only call init_template when we have a template



commit 7ee02940a0dabd672028c2cd23ffe6886d9e670f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Sep 30 14:04:01 2014 -0600

    overrides/Gtk: Only call init_template when we have a template
    
    Otherwise, we'll get a warning about how we don't have a template.

 modules/overrides/Gtk.js |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/modules/overrides/Gtk.js b/modules/overrides/Gtk.js
index c8668c7..7a1c4b0 100644
--- a/modules/overrides/Gtk.js
+++ b/modules/overrides/Gtk.js
@@ -40,9 +40,11 @@ const GtkWidgetClass = new Lang.Class({
         let internalChildren = params.InternalChildren;
         delete params.internalChildren;
 
-        params._instance_init = function() {
-            this.init_template();
-        };
+        if (template) {
+            params._instance_init = function() {
+                this.init_template();
+            };
+        }
 
         this.parent(params);
 


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