Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19555

Android: HTTPClient fails when no contentType is specified in response

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 5.0.0
    • Fix Version/s: Release 5.1.0
    • Component/s: Android
    • Labels:
      None
    • Environment:

      Appcelerator Studio 4.3.0
      CLI 5.0.1
      TItanium SDK 5.0.0.GA
      Android 5.0.1

    • Story Points:
      1
    • Sprint:
      2015 Sprint 19 SDK

      Description

      HTTPClient fails with the error below,

      [ERROR] :  TiHTTPClient: (TiHttpClient-40) [9,1211] HTTP Error (java.lang.NullPointerException): Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference
      [ERROR] :  TiHTTPClient: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference
      [ERROR] :  TiHTTPClient: 	at ti.modules.titanium.network.TiHTTPClient.handleResponse(TiHTTPClient.java:196)
      [ERROR] :  TiHTTPClient: 	at ti.modules.titanium.network.TiHTTPClient.access$1200(TiHTTPClient.java:84)
      [ERROR] :  TiHTTPClient: 	at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1195)
      [ERROR] :  TiHTTPClient: 	at java.lang.Thread.run(Thread.java:818)
      

      when no contentType is specified in response header. Till 4.x this was working, breaking only on 5.0.0.GA.

      Note: As mentioned in docs here http://developer.android.com/reference/java/net/URLConnection.html#getContentType() it may return a string or null when type is unknown which is not handled here https://github.com/appcelerator/titanium_mobile/blob/24c69f037e9b4f91713c33c7afb7ffd31bc77933/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java#L193

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                msamah Ashraf Abu (Inactive)
                Reporter:
                mano_mykingdom Manojkumar Murugesan
                Reviewer:
                Ashraf Abu (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-20381
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code