Fix bug in btngroup anchoring when anchor doesn't exist

Change-Id: Id89aa31edf6d9ee06046b22f6f4cefa34366f46e
diff --git a/dev/js/src/buttongroup.js b/dev/js/src/buttongroup.js
index 721fdcb..dabe710 100644
--- a/dev/js/src/buttongroup.js
+++ b/dev/js/src/buttongroup.js
@@ -57,7 +57,7 @@
      * Define element following newly added buttons.
      */
     anchor : function (anchor) {
-      if (anchor.parentNode == this._el) {
+      if (anchor !== null && anchor.parentNode == this._el) {
         this._anchor = anchor;
         return true;
       };