OneBusAway / onebusaway-alexa

An Java-based app to communicate with Amazon Alexa for devices such as the Amazon Echo
Other
52 stars 18 forks source link

NPE when trying to set city without city name #29

Closed barbeau closed 8 years ago

barbeau commented 8 years ago

After initial setup, I asked "Alexa, ask OneBusAway to set my city", and got the below log:

DEBUG request - Received successful response: 200, AWS Request ID: LAP6KUCBG7F949DQR99HJGCL8FVV4KQNSO5AEMVJF66Q9ASUAAJG 
DEBUG DefaultListableBeanFactory - Returning cached instance of singleton bean 'authedSpeechlet' 
DEBUG ObaUserClient - Instantiating ObaUserClient with obaBaseUrl http://api.tampa.onebusaway.org/api/ 
DEBUG GoogleMaps - Entered Google API 
ERROR GoogleMaps - Got exception from GeocodingApi: java.lang.NullPointerException 
ERROR MainSpeechlet - Intent exception: null 
ERROR MainSpeechlet - Backtrace: 
[Ljava.lang.StackTraceElement;@1877ab81 
java.lang.NullPointerException 
 at java.net.URLEncoder.encode(URLEncoder.java:204) 
 at com.google.maps.GeoApiContext.get(GeoApiContext.java:73) 
 at com.google.maps.PendingResultBase.makeRequest(PendingResultBase.java:79) 
 at com.google.maps.PendingResultBase.await(PendingResultBase.java:55) 
 at org.onebusaway.alexa.lib.GoogleMaps.geocode(GoogleMaps.java:50) 
 at org.onebusaway.alexa.AnonSpeechlet.onIntent(AnonSpeechlet.java:95) 
 at org.onebusaway.alexa.AuthedSpeechlet.onIntent(AuthedSpeechlet.java:63) 
 at org.onebusaway.alexa.MainSpeechlet.onIntent(MainSpeechlet.java:45) 
 at com.amazon.speech.speechlet.SpeechletRequestDispatcher.dispatchSpeechletCall(SpeechletRequestDispatcher.java:63) 
 at com.amazon.speech.speechlet.SpeechletRequestHandler.handleSpeechletCall(SpeechletRequestHandler.java:69) 
 at com.amazon.speech.speechlet.lambda.SpeechletRequestStreamHandler.handleRequest(SpeechletRequestStreamHandler.java:81) 
 at lambdainternal.EventHandlerLoader$2.call(EventHandlerLoader.java:967) 
 at lambdainternal.AWSLambda.startRuntime(AWSLambda.java:231) 
 at lambdainternal.AWSLambda.<clinit>(AWSLambda.java:59) 
 at java.lang.Class.forName0(Native Method) 
 at java.lang.Class.forName(Class.java:348) 
 at lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:93) 
java.lang.NullPointerException: java.lang.NullPointerException java.lang.NullPointerException at java.util.Objects.requireNonNull(Objects.java:203) at java.util.Optional.<init>(Optional.java:96) at java.util.Optional.of(Optional.java:108) at org.onebusaway.alexa.AnonSpeechlet.onIntent(AnonSpeechlet.java:98) at org.onebusaway.alexa.AuthedSpeechlet.onIntent(AuthedSpeechlet.java:63) at org.onebusaway.alexa.MainSpeechlet.onIntent(MainSpeechlet.java:45) at com.amazon.speech.speechlet.SpeechletRequestDispatcher.dispatchSpeechletCall(SpeechletRequestDispatcher.java:63) at com.amazon.speech.speechlet.SpeechletRequestHandler.handleSpeechletCall(SpeechletRequestHandler.java:69) at com.amazon.speech.speechlet.lambda.SpeechletRequestStreamHandler.handleRequest(SpeechletRequestStreamHandler.java:81)  
END RequestId: dde4dffd-e40d-11e5-937d-ab40b8751103
barbeau commented 8 years ago

Fixed via https://github.com/OneBusAway/onebusaway-alexa/pull/38.