From 0a294476a440d3b2d7cd4f7c60773ff850f9aa8e Mon Sep 17 00:00:00 2001
From: coulbeck <coulbeck@localhost>
Date: Tue, 17 Oct 2006 16:09:03 +0000
Subject: [PATCH] Fix for  [Issue 635]  NullPointerException when trying to access non existing entry.  Reviewed by gbellato.

---
 opends/src/server/org/opends/server/synchronization/OperationContext.java |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/opends/src/server/org/opends/server/synchronization/OperationContext.java b/opends/src/server/org/opends/server/synchronization/OperationContext.java
index 89c7e5c..fb48525 100644
--- a/opends/src/server/org/opends/server/synchronization/OperationContext.java
+++ b/opends/src/server/org/opends/server/synchronization/OperationContext.java
@@ -71,9 +71,9 @@
   }
 
   /**
-   * Get the unique Identifier of the modiffied entry.
+   * Get the unique Identifier of the modified entry.
    *
-   * @return the unique Identifier of the modiffied entry.
+   * @return the unique Identifier of the modified entry.
    */
   public String getEntryUid()
   {
@@ -84,11 +84,16 @@
    * Get the change number of an operation.
    *
    * @param op The operation.
-   * @return the change number of the provided operation.
+   * @return The change number of the provided operation, or null if there is
+   * no change number associated with the operation.
    */
   public static ChangeNumber getChangeNumber(Operation op)
   {
     OperationContext ctx = (OperationContext)op.getAttachment(SYNCHROCONTEXT);
+    if (ctx == null)
+    {
+      return null;
+    }
     return ctx.changeNumber;
   }
 

--
Gitblit v1.10.0