X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=plugins%2Fnet.mograsim.plugin.core%2Fsrc%2Fnet%2Fmograsim%2Fplugin%2Feditors%2FMemoryEditor.java;h=b367f3a4aadcce123949c3317f517234490a2c30;hb=d55dc585ecd9f8bfd800ba7a034ab1e6b6bba2b3;hp=028a1b5be295a41978073e10b63f079f151f09bc;hpb=c356c613955c3ea57d2379fb76f9bd07f1e30170;p=Mograsim.git diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java index 028a1b5b..b367f3a4 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java @@ -111,19 +111,21 @@ public class MemoryEditor extends EditorPart Text amountText = new Text(parent, SWT.BORDER); amountText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); amountText.addVerifyListener(vl); - amountText.setText("0"); amountText.addModifyListener(e -> { try { - provider.setAmount(AsmNumberUtil.valueOf(amountText.getText()).intValue()); - viewer.refresh(); + if (provider != null) + provider.setAmount(AsmNumberUtil.valueOf(amountText.getText()).intValue()); + if (viewer != null) + viewer.refresh(); } catch (NumberFormatException x) { // Nothing to do here } }); + amountText.setText("100");// do this after registering the ModifyListener new RadixSelector(parent, displaySettings); addActivationButton(parent);