0b3d41a - Allow frame creation without clickheal
authorAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Mon, 11 Feb 2019 22:35:13 +0000
committerAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Mon, 11 Feb 2019 22:35:13 +0000
kehys/frame.lua

index 252b971..57578c7 100644 (file)
@@ -24,14 +24,15 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes,
     assert(type(width) == "number", "Frame creation missing width!");
     assert(type(height) == "number", "Frame creation missing height!");
     assert(type(unit) == "string", "Frame creation missing unit!");
-    assert(type(attributes) == "table",
-           "Frame creation missing attributes table!");
     assert(type(update) == "function",
            "Frame creation missing update function!");
     assert(type(event) == "function",
            "Frame creation missing event function!");
     assert(type(onshow) == "function",
            "Frame creation missing onshow function!");
+    if type(attributes) ~= "table" then
+        attributes = {};
+    end
 
     local f = CreateFrame(
         "Button",