Fixed MemoryTableContentProvider#update throwing an exception
[Mograsim.git] / plugins / net.mograsim.plugin.core / src / net / mograsim / plugin / tables / memory / MemoryTableContentProvider.java
index 90ad788..3d67c9d 100644 (file)
@@ -54,9 +54,12 @@ public class MemoryTableContentProvider implements ILazyContentProvider, MemoryC
        @Override
        public void updateElement(int index)
        {
-               long address = lower + index;
-               if (address <= memory.getDefinition().getMaximalAddress())
-                       viewer.replace(new MemoryTableRow(address, memory), index);
+               if (index < amount)
+               {
+                       long address = lower + index;
+                       if (address <= memory.getDefinition().getMaximalAddress())
+                               viewer.replace(new MemoryTableRow(address, memory), index);
+               }
        }
 
        @Override