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

Android: Ti.Filesystem.getFile causes hard crash with null argument

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Release 5.4.0
    • Fix Version/s: Release 6.0.0
    • Component/s: Android
    • Labels:
      None
    • Sprint:
      2016 Sprint 13 SDK

      Description

      In our mocha tests suite we used Ti.Filesystem.applicationDirectory to access files from the app Resources directory (xml files, js files, etc). Apparently this property is undefined/null on Android and we should instead be using Ti.Filesystem.resourcesDirectory.

      However, if we do something like:

      Ti.Filesystem.getFile(Ti.Filesystem.applicationDirectory, 'app.js');
      

      That code will hard-crash Android with an NPE. Considering that is valid code on iOS, and that we don't complain/spit out an error - but actually crash the app, I'd think we might want to safeguard a little better here. If we see a null in the path arguments, we should probably spit out an error and return null.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hpham Hieu Pham
                Reporter:
                cwilliams Christopher Williams
                Reviewer:
                Ashraf Abu (Inactive)
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code