Fixed reference equality checks for PwUuid

This commit is contained in:
AlexVallat 2013-07-13 08:14:32 +01:00
parent f06ce9c58b
commit bf84662857
2 changed files with 4 additions and 4 deletions

View File

@ -58,8 +58,8 @@ namespace KeePassLib
{
Debug.Assert(pwUuid != null);
if(pwUuid == null) throw new ArgumentNullException("pwUuid");
Debug.Assert(pwUuid != PwUuid.Zero);
if(pwUuid == PwUuid.Zero) throw new ArgumentException("pwUuid == 0");
Debug.Assert(!pwUuid.EqualsValue(PwUuid.Zero));
if(pwUuid.EqualsValue(PwUuid.Zero)) throw new ArgumentException("pwUuid == 0");
Debug.Assert(pbImageDataPng != null);
if(pbImageDataPng == null) throw new ArgumentNullException("pbImageDataPng");

View File

@ -377,7 +377,7 @@ namespace KeePassLib.Serialization
WriteObject(ElemNotes, pg.Notes, true);
WriteObject(ElemIcon, (int)pg.IconId);
if(pg.CustomIconUuid != PwUuid.Zero)
if(!pg.CustomIconUuid.EqualsValue(PwUuid.Zero))
WriteObject(ElemCustomIconID, pg.CustomIconUuid);
WriteList(ElemTimes, pg);
@ -402,7 +402,7 @@ namespace KeePassLib.Serialization
WriteObject(ElemUuid, pe.Uuid);
WriteObject(ElemIcon, (int)pe.IconId);
if(pe.CustomIconUuid != PwUuid.Zero)
if(!pe.CustomIconUuid.EqualsValue(PwUuid.Zero))
WriteObject(ElemCustomIconID, pe.CustomIconUuid);
WriteObject(ElemFgColor, StrUtil.ColorToUnnamedHtml(pe.ForegroundColor, true), false);