Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

Commit

Permalink
Entries being merged no longer require a pre-existing "KPRPC JSON" ad…
Browse files Browse the repository at this point in the history
…vanced string. Fixes #480
  • Loading branch information
luckyrat committed Jun 12, 2015
1 parent 5e184d3 commit 4a96d6a
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions KeePassRPC/KeePassRPCService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1490,26 +1490,40 @@ private void MergeEntries(PwEntry destination, PwEntry source, int urlMergeMode,
{
EntryConfig destConfig;
string destJSON = KeePassRPCPlugin.GetPwEntryString(destination, "KPRPC JSON", db);
try
if (string.IsNullOrEmpty(destJSON))
{
destConfig = (EntryConfig)Jayrock.Json.Conversion.JsonConvert.Import(typeof(EntryConfig), destJSON);
destConfig = new EntryConfig();
}
catch (Exception)
else
{
MessageBox.Show("There are configuration errors in this entry. To fix the entry and prevent this warning message appearing, please edit the value of the 'KeePassRPC JSON config' advanced string. Please ask for help on http://keefox.org/help/forum if you're not sure how to fix this. The URL of the entry is: " + destination.Strings.ReadSafe("URL") + " and the full configuration data is: " + destJSON, "Warning: Configuration errors", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
try
{
destConfig = (EntryConfig)Jayrock.Json.Conversion.JsonConvert.Import(typeof(EntryConfig), destJSON);
}
catch (Exception)
{
MessageBox.Show("There are configuration errors in this entry. To fix the entry and prevent this warning message appearing, please edit the value of the 'KeePassRPC JSON config' advanced string. Please ask for help on http://keefox.org/help/forum if you're not sure how to fix this. The URL of the entry is: " + destination.Strings.ReadSafe("URL") + " and the full configuration data is: " + destJSON, "Warning: Configuration errors", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}

EntryConfig sourceConfig;
string sourceJSON = KeePassRPCPlugin.GetPwEntryString(source, "KPRPC JSON", db);
try
if (string.IsNullOrEmpty(sourceJSON))
{
sourceConfig = (EntryConfig)Jayrock.Json.Conversion.JsonConvert.Import(typeof(EntryConfig), sourceJSON);
sourceConfig = new EntryConfig();
}
catch (Exception)
else
{
MessageBox.Show("There are configuration errors in this entry. To fix the entry and prevent this warning message appearing, please edit the value of the 'KeePassRPC JSON config' advanced string. Please ask for help on http://keefox.org/help/forum if you're not sure how to fix this. The URL of the entry is: " + source.Strings.ReadSafe("URL") + " and the full configuration data is: " + sourceJSON, "Warning: Configuration errors", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
try
{
sourceConfig = (EntryConfig)Jayrock.Json.Conversion.JsonConvert.Import(typeof(EntryConfig), sourceJSON);
}
catch (Exception)
{
MessageBox.Show("There are configuration errors in this entry. To fix the entry and prevent this warning message appearing, please edit the value of the 'KeePassRPC JSON config' advanced string. Please ask for help on http://keefox.org/help/forum if you're not sure how to fix this. The URL of the entry is: " + source.Strings.ReadSafe("URL") + " and the full configuration data is: " + sourceJSON, "Warning: Configuration errors", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}

destination.CreateBackup(db);
Expand Down

0 comments on commit 4a96d6a

Please sign in to comment.