Skip to main content
summaryrefslogtreecommitdiffstats
path: root/memory
diff options
context:
space:
mode:
authorJohn Cortell2010-09-02 12:44:02 -0400
committerJohn Cortell2010-09-02 12:44:02 -0400
commit213901d4508f08c09d8a43735cb7bbd93c442cc3 (patch)
tree1c08c63b7c347431a001c5fe497b639e7b548bae /memory
parentfff45080d07fea3b16b47f0c2f68ed9b1ad5362a (diff)
downloadorg.eclipse.cdt-213901d4508f08c09d8a43735cb7bbd93c442cc3.tar.gz
org.eclipse.cdt-213901d4508f08c09d8a43735cb7bbd93c442cc3.tar.xz
org.eclipse.cdt-213901d4508f08c09d8a43735cb7bbd93c442cc3.zip
Fix potential null pointer use
Diffstat (limited to 'memory')
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java4
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java4
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/actions/ExportMemoryAction.java4
3 files changed, 8 insertions, 4 deletions
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java
index 43a25c5e48..67f012ffb3 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java
@@ -416,7 +416,9 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IM
} catch (DebugException e1) {
fGotoAddressBar.handleExpressionStatus(new Status(Status.ERROR, MemoryBrowserPlugin.PLUGIN_ID,
Messages.getString("MemoryBrowser.FailedToGoToAddressTitle"), e1)); //$NON-NLS-1$
- item.dispose();
+ if (item != null) {
+ item.dispose();
+ }
return;
}
} else {
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java
index fe8acb8c19..60e23b494e 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java
@@ -1235,7 +1235,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
boolean changed = false;
- if(fStartHigh == null || !high.equals(fStartHigh))
+ if(fStartHigh == null || !fStartHigh.equals(high))
{
fStartHigh = high;
changed = true;
@@ -1267,7 +1267,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
boolean changed = false;
- if(fEndHigh == null || !high.equals(fEndHigh))
+ if(fEndHigh == null || !fEndHigh.equals(high))
{
fEndHigh = high;
changed = true;
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/actions/ExportMemoryAction.java b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/actions/ExportMemoryAction.java
index 075ed6150e..1fd2464adb 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/actions/ExportMemoryAction.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/actions/ExportMemoryAction.java
@@ -99,7 +99,9 @@ public class ExportMemoryAction implements IViewActionDelegate {
}
}
else {
- initialStartAddr = BigInteger.valueOf(memBlock.getStartAddress());
+ if (memBlock != null) {
+ initialStartAddr = BigInteger.valueOf(memBlock.getStartAddress());
+ }
}
}
}

Back to the top