Fix:Core:Avoid errors while running osm2navit
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 7 Oct 2009 11:00:12 +0000 (11:00 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 7 Oct 2009 11:00:12 +0000 (11:00 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit@2644 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/atom.c

index d225797..de11ce8 100644 (file)
@@ -6,6 +6,8 @@ static GHashTable *atom_hash;
 char *
 atom_lookup(char *name)
 {
+       if (!atom_hash)
+               return NULL;
        return g_hash_table_lookup(atom_hash,name);
 }
 
@@ -15,6 +17,8 @@ atom(char *name)
        char *id=atom_lookup(name);
        if (id)
                return id;
+       if (!atom_hash)
+               return NULL;
        id=g_strdup(name);
        g_hash_table_insert(atom_hash, id, id);
        return id;