This was done in wxMSW and wxQt but not in the native GTK+ nor the generic version, even though they still asserted when actually trying to use the invalid parameter later. Make things more clear and consistent by asserting immediately and also document the behaviour more clearly.