Skip to content
Snippets Groups Projects
Commit 2cd26154 authored by Lukas Ladenberger's avatar Lukas Ladenberger
Browse files

fixed bug in switch coordinates observer: error message was shown when x

or y was no valid integer
parent 3a859c90
No related branches found
No related tags found
No related merge requests found
...@@ -293,10 +293,13 @@ public abstract class BControl implements IAdaptable, Cloneable { ...@@ -293,10 +293,13 @@ public abstract class BControl implements IAdaptable, Cloneable {
// TODO: check if strings are a correct integers // TODO: check if strings are a correct integers
try {
int width = Integer.valueOf(widthStr); int width = Integer.valueOf(widthStr);
int height = Integer.valueOf(heightStr); int height = Integer.valueOf(heightStr);
int x = Integer.valueOf(xStr); int x = Integer.valueOf(xStr);
int y = Integer.valueOf(yStr); int y = Integer.valueOf(yStr);
if (layout == null) { if (layout == null) {
layout = new Rectangle(x, y, width, height); layout = new Rectangle(x, y, width, height);
} else { } else {
...@@ -305,6 +308,13 @@ public abstract class BControl implements IAdaptable, Cloneable { ...@@ -305,6 +308,13 @@ public abstract class BControl implements IAdaptable, Cloneable {
layout.width = width; layout.width = width;
layout.height = height; layout.height = height;
} }
} catch (NumberFormatException e) {
// We ignore number format exceptions, however we should return an
// error message here
// TODO: return error message
}
return layout; return layout;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment