Fixed bug with loading attachments from kdb

Update to GPL V3
Regard CanWrite in UI
This commit is contained in:
Philipp Crocoll
2014-01-26 05:27:27 -08:00
parent 8bbd18d3f8
commit dc4088e7c7
71 changed files with 2436 additions and 6611 deletions

View File

@@ -125,7 +125,7 @@ namespace keepass2android
SetFieldIfAvailable(pwEntry, PwDefs.PasswordField, true, entryV3.Password);
SetFieldIfAvailable(pwEntry, PwDefs.NotesField, true, entryV3.Additional);
if (entryV3.GetBinaryData() != null)
if ((entryV3.GetBinaryData() != null) && (entryV3.GetBinaryData().Length > 0))
{
pwEntry.Binaries.Set(entryV3.BinaryDesc, new ProtectedBinary(true, entryV3.GetBinaryData()));
}

View File

@@ -83,6 +83,13 @@ namespace keepass2android
{
try
{
if (_app.GetDb().CanWrite == false)
{
//this should only happen if there is a problem in the UI so that the user sees an edit interface.
Finish(false,"Cannot save changes. File is read-only!");
return;
}
StatusLogger.UpdateMessage(UiStringKey.saving_database);
IOConnectionInfo ioc = _app.GetDb().Ioc;
IFileStorage fileStorage = _app.GetFileStorage(ioc);