mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-17 00:44:40 -04:00
fixed a bug in the splitter, which ocures if definition is invalid
This commit is contained in:
parent
a2b554ddc5
commit
4b54430a17
@ -272,8 +272,11 @@ public class Splitter implements Element {
|
||||
if (pos >= 0) {
|
||||
int from = Integer.decode(strVal.substring(0, pos).trim());
|
||||
int to = Integer.decode(strVal.substring(pos + 1).trim());
|
||||
if (to < from)
|
||||
throw new BitsException(Lang.get("err_spitterDefSyntaxError", definition));
|
||||
if (to < from) {
|
||||
int z = to;
|
||||
to = from;
|
||||
from = z;
|
||||
}
|
||||
add(new Port(from, to - from + 1));
|
||||
} else
|
||||
add(new Port(bits, Integer.decode(strVal)));
|
||||
|
@ -50,7 +50,7 @@ public class MissingShape implements Shape {
|
||||
while (c != null) {
|
||||
y += style.getFontSize();
|
||||
String message = c.getMessage();
|
||||
if (message.length() > 100)
|
||||
if (message != null && message.length() > 100)
|
||||
message = message.substring(0, 100) + "...";
|
||||
graphic.drawText(new Vector(4, y), new Vector(5, y), message, Orientation.LEFTTOP, style);
|
||||
c = c.getCause();
|
||||
|
Loading…
x
Reference in New Issue
Block a user