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

Android: Crash after calling Stringify on Ti.UI.Window

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 6.2.0
    • Fix Version/s: Release 7.0.0
    • Component/s: Android
    • Labels:

      Description

      Calling `Stringify` on a Window instance before it has been opened crashes the application.

      Test case:

      var win = Ti.UI.createWindow();
      Ti.API.error(JSON.stringify(win));
      win.open();
      

      Result: Application crashes.
      Expected behavior: Application should not crash.

      Console log:

      [WARN] :   W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.support.v7.app.ActionBar.setDisplayOptions(int)’ on a null object reference
      [WARN] :   W/System.err:     at org.appcelerator.titanium.proxy.ActionBarProxy.<init>(ActionBarProxy.java:58)
      [WARN] :   W/System.err:     at org.appcelerator.titanium.proxy.ActivityProxy.getActionBar(ActivityProxy.java:258)
      [WARN] :   W/System.err:     at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
      [WARN] :   W/System.err:     at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:196)
      [WARN] :   W/System.err:     at org.appcelerator.kroll.KrollRuntime.runModule(KrollRuntime.java:243)
      [WARN] :   W/System.err:     at org.appcelerator.titanium.TiLaunchActivity.loadActivityScript(TiLaunchActivity.java:128)
      [WARN] :   W/System.err:     at org.appcelerator.titanium.TiLaunchActivity.windowCreated(TiLaunchActivity.java:183)
      [WARN] :   W/System.err:     at org.appcelerator.titanium.TiRootActivity.windowCreated(TiRootActivity.java:172)
      [WARN] :   W/System.err:     at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:684)
      [WARN] :   W/System.err:     at org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:169)
      [WARN] :   W/System.err:     at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:161)
      [WARN] :   W/System.err:     at android.app.Activity.performCreate(Activity.java:6679)
      [WARN] :   W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
      [WARN] :   W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
      [WARN] :   W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
      [WARN] :   W/System.err:     at android.app.ActivityThread.-wrap12(ActivityThread.java)
      [WARN] :   W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
      [WARN] :   W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
      [WARN] :   W/System.err:     at android.os.Looper.loop(Looper.java:154)
      [WARN] :   W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:6119)
      [WARN] :   W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
      [WARN] :   W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
      [WARN] :   W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ybanev Yordan Banev
                Reporter:
                ybanev Yordan Banev
                Reviewer:
                Gary Mathews
                Tester:
                Abir Mukherjee
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code