Skip to content

Commit d26d0e3

Browse files
committed
Fix exception
Throw invalid argument exception if the type of the provider is not the one expected.
1 parent c088611 commit d26d0e3

File tree

1 file changed

+2
-3
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics

1 file changed

+2
-3
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -2042,9 +2042,8 @@ private abstract class AbstractImageProviderWrapper {
20422042
abstract AbstractImageProviderWrapper createCopy(Image image);
20432043

20442044
protected void checkProvider(Object provider, Class<?> expectedClass) {
2045-
if (provider == null || !expectedClass.isAssignableFrom(provider.getClass())) {
2046-
SWT.error(SWT.ERROR_NULL_ARGUMENT);
2047-
}
2045+
if (provider == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
2046+
if (!expectedClass.isAssignableFrom(provider.getClass())) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
20482047
}
20492048

20502049
@Override

0 commit comments

Comments
 (0)