File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .schabi .newpipe .downloader ;
22
33import org .schabi .newpipe .extractor .downloader .Downloader ;
4+ import org .schabi .newpipe .extractor .utils .Utils ;
45
56import java .util .Locale ;
67
@@ -23,7 +24,7 @@ private static DownloaderType getDownloaderType() {
2324
2425 private static DownloaderType determineDownloaderType () {
2526 String propValue = System .getProperty ("downloader" );
26- if (propValue == null ) {
27+ if (Utils . isNullOrEmpty ( propValue ) ) {
2728 return DEFAULT_DOWNLOADER ;
2829 }
2930 propValue = propValue .toUpperCase ();
@@ -33,8 +34,8 @@ private static DownloaderType determineDownloaderType() {
3334 }
3435 try {
3536 return DownloaderType .valueOf (propValue );
36- } catch (final Exception e ) {
37- return DEFAULT_DOWNLOADER ;
37+ } catch (final IllegalArgumentException e ) {
38+ throw new IllegalArgumentException ( "Unknown downloader name: " + propValue , e ) ;
3839 }
3940 }
4041
You can’t perform that action at this time.
0 commit comments