summaryrefslogtreecommitdiff
path: root/navit/navit.c
diff options
context:
space:
mode:
authortegzed <tegzed@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-09-10 08:59:26 +0000
committertegzed <tegzed@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-09-10 08:59:26 +0000
commitf8b6e0b584d844d9fca836e1d734cdae1fe3630c (patch)
tree186e164388671114d6483a0b6dca27f41f6affb8 /navit/navit.c
parent8b4d95b3b2cca34321519e619e5ec93dbce5b71b (diff)
downloadnavit-f8b6e0b584d844d9fca836e1d734cdae1fe3630c.tar.gz
fix:core:-stabilize adding map items
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4773 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/navit.c')
-rw-r--r--navit/navit.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/navit/navit.c b/navit/navit.c
index 9088b6e6e..479e4578e 100644
--- a/navit/navit.c
+++ b/navit/navit.c
@@ -847,9 +847,10 @@ navit_cmd_map_add_curr_pos(struct navit *this, char *function, struct attr **in,
struct map* curr_map = NULL;
struct coord curr_coord;
struct map_rect *mr;
-
- val->type = attr_type_item_begin;
- val->u.item = NULL; //return invalid item on error
+
+ //return invalid item on error
+ val->type = attr_none;
+ val->u.item = NULL;
list[0] = val;
list[1] = NULL;
*out = list;
@@ -896,7 +897,10 @@ navit_cmd_map_add_curr_pos(struct navit *this, char *function, struct attr **in,
mr = map_rect_new(curr_map, &sel);
if(mr) {
it = map_rect_create_item( mr, item_type);
- item_coord_set(it,&curr_coord, 1, change_mode_modify);
+ if (it) {
+ val->type = attr_type_item_begin;
+ item_coord_set(it,&curr_coord, 1, change_mode_modify);
+ }
val->u.item = it;
}
map_rect_destroy(mr);