npe fix for file upload on instance saving since actionbar in list mode doesn't habe...
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / FileActivity.java
index 0869ba6..a3e895e 100644 (file)
@@ -386,13 +386,6 @@ public class FileActivity extends AppCompatActivity
 
         mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,R.string.drawer_open,R.string.drawer_close) {
 
-            //new ActionBarDrawerToggle(
-            //this,
-            //  mDrawerLayout,
-            //  R.drawable.ic_drawer,
-            //  R.string.app_name,
-            //  R.string.drawer_close) {
-
             /** Called when a drawer has settled in a completely closed state. */
             public void onDrawerClosed(View view) {
                 super.onDrawerClosed(view);
@@ -408,8 +401,7 @@ public class FileActivity extends AppCompatActivity
                 invalidateOptionsMenu();
             }
         };
-
-        //mDrawerToggle.setDrawerIndicatorEnabled(true);
+        
         // Set the list's click listener
         mDrawerList.setOnItemClickListener(new DrawerItemClickListener());
 
@@ -535,7 +527,11 @@ public class FileActivity extends AppCompatActivity
         outState.putBoolean(FileActivity.EXTRA_FROM_NOTIFICATION, mFromNotification);
         outState.putLong(KEY_WAITING_FOR_OP_ID, mFileOperationsHelper.getOpIdWaitingFor());
         outState.putBoolean(KEY_TRY_SHARE_AGAIN, mTryShareAgain);
-        outState.putString(KEY_ACTION_BAR_TITLE, getSupportActionBar().getTitle().toString());
+        if(getSupportActionBar().getTitle() != null) {
+            // Null check in case the actionbar is used in ActionBar.NAVIGATION_MODE_LIST
+            // since it doesn't have a title then
+            outState.putString(KEY_ACTION_BAR_TITLE, getSupportActionBar().getTitle().toString());
+        }
     }