Hey guys,

Im working on the paypal response processing in my paypal module and I
have the following code:

 val reader: BufferedReader = new BufferedReader(
      new InputStreamReader(
        post.getResponseBodyAsStream()
      )
    )
    var line: String = null
    try {
      while ({line = reader.readLine(); line != null}){
        println("########## " + line)
      }
    } finally {
      if(reader != null){
        reader.close
      }
    }

I keep getting this stack trace:

java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:61)
        at java.io.InputStreamReader.<init>(InputStreamReader.java:55)
        at
net.liftweb.paypal.PaypalResponse.getProcessedResponse(Paypal.scala:
99)
        at net.liftweb.paypal.PaypalResponse.<init>(Paypal.scala:92)
        at
net.liftweb.paypal.PaypalDataTransferReponse.<init>(Paypal.scala:198)
        at net.liftweb.paypal.PaypalDataTransfer.execute(Paypal.scala:
178)

Now then, line 99 in my code is:

      new InputStreamReader(

I've tried all manner of things to work around this but keep hitting a
brick wall. The strange thing is that the loop prints out the lines in
the stream no problem, but then as it hits the end of the stream I
*always* get this NPE.

Does anyone have any words of wisdom?

Cheers

Tim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to