# HG changeset patch # User Frank Benoit # Date 1215362741 -7200 # Node ID dffb802cad030ae6a3aaa887d418218a59ead5bd # Parent f6169caa2e0579db8d81c5e125f0c7b8c0454f14 Fix: StyledText.paste() to check for empty clipboard result. diff -r f6169caa2e05 -r dffb802cad03 dwt/custom/StyledText.d --- a/dwt/custom/StyledText.d Sun Jul 06 17:34:59 2008 +0200 +++ b/dwt/custom/StyledText.d Sun Jul 06 18:45:41 2008 +0200 @@ -6038,7 +6038,10 @@ */ public void paste(){ checkWidget(); - String text = (cast(ArrayWrapperString) getClipboardContent(DND.CLIPBOARD)).array; + String text = null; + if( auto o = cast(ArrayWrapperString) getClipboardContent(DND.CLIPBOARD)){ + text = o.array; + } if (text !is null && text.length > 0) { Event event = new Event(); event.start = selection.x;