Merge pull request #5420 from hitch17/load-deck-content-from-clipboard

Prepopulate DeckImportFromClipboardDialog content with string content…
This commit is contained in:
Oleg Agafonov 2018-11-17 11:36:43 +04:00 committed by GitHub
commit 6fa014d1a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 5 deletions

View file

@ -39,7 +39,9 @@ public final class DeckImporterUtil {
}
public static DeckImporter getDeckImporter(String file) {
if (file.toLowerCase(Locale.ENGLISH).endsWith("dec")) {
if (file == null) {
return null;
} if (file.toLowerCase(Locale.ENGLISH).endsWith("dec")) {
return new DecDeckImporter();
} else if (file.toLowerCase(Locale.ENGLISH).endsWith("mwdeck")) {
return new MWSDeckImporter();