- image field editor dialog throw npe when user want to reset
This commit is contained in:
parent
0880878b70
commit
c1b8fd3f32
|
@ -90,7 +90,6 @@ public class WImageDialog extends Window implements EventListener
|
||||||
}
|
}
|
||||||
|
|
||||||
fileButton.setLabel(m_mImage.getName());
|
fileButton.setLabel(m_mImage.getName());
|
||||||
// imageLabel.setIcon(m_mImage.getIcon());
|
|
||||||
AEnv.showCenterScreen(this);
|
AEnv.showCenterScreen(this);
|
||||||
} // WImageDialog
|
} // WImageDialog
|
||||||
|
|
||||||
|
@ -157,10 +156,16 @@ public class WImageDialog extends Window implements EventListener
|
||||||
|
|
||||||
else if (e.getTarget().getId().equals(ConfirmPanel.A_OK))
|
else if (e.getTarget().getId().equals(ConfirmPanel.A_OK))
|
||||||
{
|
{
|
||||||
if (m_mImage.save())
|
if (image.getContent() != null)
|
||||||
|
{
|
||||||
|
m_mImage.saveEx();
|
||||||
|
}
|
||||||
|
else if (m_mImage != null && m_mImage.getAD_Image_ID() > 0)
|
||||||
|
{
|
||||||
|
m_mImage.deleteEx(true);
|
||||||
|
m_mImage = null;
|
||||||
|
}
|
||||||
detach();
|
detach();
|
||||||
else
|
|
||||||
FDialog.error(-1, "Failed to save image");
|
|
||||||
}
|
}
|
||||||
else if (e.getTarget().getId().equals(ConfirmPanel.A_CANCEL))
|
else if (e.getTarget().getId().equals(ConfirmPanel.A_CANCEL))
|
||||||
{
|
{
|
||||||
|
@ -169,7 +174,6 @@ public class WImageDialog extends Window implements EventListener
|
||||||
}
|
}
|
||||||
else if (e.getTarget().getId().equals(ConfirmPanel.A_RESET))
|
else if (e.getTarget().getId().equals(ConfirmPanel.A_RESET))
|
||||||
{
|
{
|
||||||
m_mImage = null;
|
|
||||||
AImage img = null;
|
AImage img = null;
|
||||||
image.setContent(img);
|
image.setContent(img);
|
||||||
}
|
}
|
||||||
|
@ -226,6 +230,8 @@ public class WImageDialog extends Window implements EventListener
|
||||||
invalidate();
|
invalidate();
|
||||||
|
|
||||||
// Save info
|
// Save info
|
||||||
|
if (m_mImage == null)
|
||||||
|
m_mImage = MImage.get (Env.getCtx(), 0);
|
||||||
m_mImage.setName(fileName);
|
m_mImage.setName(fileName);
|
||||||
m_mImage.setImageURL(fileName);
|
m_mImage.setImageURL(fileName);
|
||||||
if (image.getContent() != null)
|
if (image.getContent() != null)
|
||||||
|
|
Loading…
Reference in New Issue