Fix crash with 2nd or 3rd root level group.

This commit is contained in:
Brian Pellin
2009-01-27 13:14:34 -06:00
parent f3c4e8d0a9
commit c78cbccae5
5 changed files with 11 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.keepass"
android:versionName="0.1.1" android:versionCode="2">
android:versionName="0.1.2" android:versionCode="3">
<application android:label="@string/app_name" android:icon="@drawable/keepass_icon">
<activity android:name=".KeePass"
android:label="@string/app_name">

View File

@@ -1,3 +1,7 @@
KeePassDroid (0.1.2)
* Fix crash when accessing the first root level group.
KeePassDroid (0.1.1)
* Minor tweaks to layout.

View File

@@ -18,5 +18,5 @@
<string name="menu_copy_user">Copy User</string>
<string name="menu_copy_pass">Copy Password</string>
<string name="pass_filename">Filename:</string>
<color name="group">#FF00FF</color>
</resources>

View File

@@ -72,8 +72,9 @@ public class Database {
gRoot = cur.parent;
gGroups.put(cur.groupId, new WeakReference<PwGroup>(cur));
populateGlobals(cur);
return;
}
return;
}
Vector childGroups = currentGroup.childGroups;

View File

@@ -19,6 +19,7 @@
*/
package com.android.keepass;
import java.lang.ref.WeakReference;
import java.util.Vector;
import org.phoneid.keepassj2me.PwEntry;
@@ -76,7 +77,8 @@ public class GroupActivity extends ListActivity {
if ( id == -1 ) {
mGroup = Database.gRoot;
} else {
mGroup = Database.gGroups.get(id).get();
WeakReference<PwGroup> wPw = Database.gGroups.get(id);
mGroup = wPw.get();
}
assert(mGroup != null);