Fix NPE in StackdriverWriter

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131603566
This commit is contained in:
shikhman 2016-08-29 10:00:17 -07:00 committed by Ben McIlwain
parent 942dc58251
commit d77dced024
2 changed files with 24 additions and 1 deletions

View file

@ -232,7 +232,7 @@ public class StackdriverWriter implements MetricWriter {
logger.info(String.format("Registered new metric descriptor %s", descriptor.getType()));
} catch (GoogleJsonResponseException jsonException) {
// Not the error we were expecting, just give up
if (!jsonException.getStatusMessage().equals("ALREADY_EXISTS")) {
if (!"ALREADY_EXISTS".equals(jsonException.getStatusMessage())) {
throw jsonException;
}