We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61e994d commit 3310574Copy full SHA for 3310574
lib/osm.cc
@@ -9,11 +9,18 @@
9
#include "std_pair.hpp"
10
11
12
-inline const char *get_tag_by_key(osmium::TagList const& obj, const char *value)
+inline const char *get_tag_by_key(osmium::TagList const& obj, const char *key)
13
{
14
- const char* v = obj.get_value_by_key(value);
15
- if (!v)
+ if (!key) {
+ PyErr_SetString(PyExc_KeyError, "Key 'None' not allowed.");
16
+ boost::python::throw_error_already_set();
17
+ }
18
+
19
+ const char* v = obj.get_value_by_key(key);
20
+ if (!v) {
21
PyErr_SetString(PyExc_KeyError, "No tag with that key.");
22
23
24
return v;
25
}
26
0 commit comments