From 37b2904909bea2e63821e0758cc84c25d9d3bd94 Mon Sep 17 00:00:00 2001 From: Ludovic Apvrille <ludovic.apvrille@telecom-paristech.fr> Date: Wed, 17 Jun 2020 17:50:13 +0200 Subject: [PATCH] Solving bug on variables loading --- src/main/java/ui/avatarbd/AvatarBDBlock.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/ui/avatarbd/AvatarBDBlock.java b/src/main/java/ui/avatarbd/AvatarBDBlock.java index 6d3278c40a..ffb92c7333 100644 --- a/src/main/java/ui/avatarbd/AvatarBDBlock.java +++ b/src/main/java/ui/avatarbd/AvatarBDBlock.java @@ -1229,14 +1229,16 @@ public class AvatarBDBlock extends TGCScalableWithInternalComponent implements S if (valueAtt.equals("null")) { valueAtt = ""; } - if ((TAttribute.isAValidId(id, false, false, false)) && (TAttribute.isAValidInitialValue(type, valueAtt))) { - //TraceManager.addDev("Adding attribute " + id + " typeOther=" + typeOther); - if (type == TAttribute.NATURAL) { - type = TAttribute.INTEGER; + if ((TAttribute.isAValidId(id, false, false, false))) { + if ((valueAtt.length() == 0 ) || ((TAttribute.isAValidInitialValue(type, valueAtt)))) { + TraceManager.addDev("Adding attribute " + id + " typeOther=" + typeOther); + if (type == TAttribute.NATURAL) { + type = TAttribute.INTEGER; + } + TAttribute ta = new TAttribute(access, id, valueAtt, type, typeOther); + ta.isAvatar = true; + this.myAttributes.add(ta); } - TAttribute ta = new TAttribute(access, id, valueAtt, type, typeOther); - ta.isAvatar = true; - this.myAttributes.add(ta); } } if (elt.getTagName().equals("blockType")) { -- GitLab