don't assing nullptr to std::string

This commit is contained in:
Konstantin Käfer
2014-12-16 11:42:58 +01:00
parent 57e6bc6e1b
commit 9082a83d6a
2 changed files with 29 additions and 22 deletions

View File

@@ -78,7 +78,10 @@ int main(int argc, char *argv[]) {
// Try to load the token from the environment.
if (!token.size()) {
token = getenv("MAPBOX_ACCESS_TOKEN");
const char *token_ptr = getenv("MAPBOX_ACCESS_TOKEN");
if (token_ptr) {
token = token_ptr;
}
}
// Set access token if present