Skip to content

Commit

Permalink
Fix exception
Browse files Browse the repository at this point in the history
Throw invalid argument exception if the type of the provider is not the
one expected.
  • Loading branch information
fedejeanne committed Dec 20, 2024
1 parent c088611 commit 21a375e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2042,9 +2042,8 @@ private abstract class AbstractImageProviderWrapper {
abstract AbstractImageProviderWrapper createCopy(Image image);

protected void checkProvider(Object provider, Class<?> expectedClass) {
if (provider == null || !expectedClass.isAssignableFrom(provider.getClass())) {
SWT.error(SWT.ERROR_NULL_ARGUMENT);
}
if (provider == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (!expectedClass.isAssignableFrom(provider.getClass())) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}

@Override
Expand Down

0 comments on commit 21a375e

Please sign in to comment.