aboutsummaryrefslogtreecommitdiff
path: root/backends/vkeybd
diff options
context:
space:
mode:
Diffstat (limited to 'backends/vkeybd')
-rw-r--r--backends/vkeybd/virtual-keyboard-parser.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/backends/vkeybd/virtual-keyboard-parser.cpp b/backends/vkeybd/virtual-keyboard-parser.cpp
index bbac503ff9..1958113578 100644
--- a/backends/vkeybd/virtual-keyboard-parser.cpp
+++ b/backends/vkeybd/virtual-keyboard-parser.cpp
@@ -313,10 +313,16 @@ bool VirtualKeyboardParser::parserCallback_area(ParserNode *node) {
return parseRect(_mode->displayArea, coords);
} else if (shape.equalsIgnoreCase("rect")) {
Polygon *poly = _mode->imageMap.createArea(target);
- return parseRectAsPolygon(*poly, coords);
+ if (!poly)
+ return parserError(Common::String::format("Cannot define area '%s' again", target.c_str()));
+ else
+ return parseRectAsPolygon(*poly, coords);
} else if (shape.equalsIgnoreCase("poly")) {
Polygon *poly = _mode->imageMap.createArea(target);
- return parsePolygon(*poly, coords);
+ if (!poly)
+ return parserError(Common::String::format("Cannot define area '%s' again", target.c_str()));
+ else
+ return parsePolygon(*poly, coords);
}
return parserError("Area shape '" + shape + "' not known");
}