Kaydet (Commit) 7b0b9da7 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1351756 Dereference before null check

Change-Id: Iae465c91693967983623087214e79e0f264c551c
üst a18d3ed2
...@@ -185,21 +185,21 @@ public class Control extends Shape ...@@ -185,21 +185,21 @@ public class Control extends Shape
else else
{ {
Size aPeerSize = getPeerSize(); Size aPeerSize = getPeerSize();
int aWidth; int nWidth;
if (aPeerSize == null) if (aPeerSize == null)
aWidth = 0; nWidth = 0;
else else
aWidth = aPeerSize.Width; nWidth = aPeerSize.Width;
// We increase the preferred Width a bit so that the control does not become too small // We increase the preferred Width a bit so that the control does not become too small
// when we change the border from "3D" to "Flat" // when we change the border from "3D" to "Flat"
if (getControlType() == FormHandler.SOCHECKBOX) if (getControlType() == FormHandler.SOCHECKBOX)
{ {
return aWidth * oFormHandler.getXPixelFactor(); return nWidth * oFormHandler.getXPixelFactor();
} }
else else
{ {
return (aWidth * oFormHandler.getXPixelFactor()) + 200; return (nWidth * oFormHandler.getXPixelFactor()) + 200;
} }
} }
} }
...@@ -213,11 +213,11 @@ public class Control extends Shape ...@@ -213,11 +213,11 @@ public class Control extends Shape
else else
{ {
Size aPeerSize = getPeerSize(); Size aPeerSize = getPeerSize();
int nHeight = aPeerSize.Height; int nHeight;
if (aPeerSize == null) if (aPeerSize == null)
nHeight = 0; nHeight = 0;
else else
nHeight = aPeerSize.Height; nHeight = aPeerSize.Height;
// We increase the preferred Height a bit so that the control does not become too small // We increase the preferred Height a bit so that the control does not become too small
// when we change the border from "3D" to "Flat" // when we change the border from "3D" to "Flat"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment