diff --git a/core/src/com/unciv/ui/mapeditor/MapEditorOptionsTable.kt b/core/src/com/unciv/ui/mapeditor/MapEditorOptionsTable.kt index 3bd211c7..90c84c40 100644 --- a/core/src/com/unciv/ui/mapeditor/MapEditorOptionsTable.kt +++ b/core/src/com/unciv/ui/mapeditor/MapEditorOptionsTable.kt @@ -114,6 +114,12 @@ class MapDownloadTable(mapEditorScreen: MapEditorScreen):PopupTable(mapEditorScr val downloadMapButton = TextButton(downloadableMap.name, CameraStageBaseScreen.skin) downloadMapButton.onClick { val mapJsonGzipped = DropBox().downloadFile(downloadableMap.path_display) + if(mapJsonGzipped==""){ + val couldNotDownloadMapPopup = PopupTable(screen) + couldNotDownloadMapPopup.addGoodSizedLabel("Could not download map!").row() + couldNotDownloadMapPopup.addCloseButton() + return@onClick + } val decodedMapJson = Gzip.unzip(mapJsonGzipped) val mapObject = MapSaver().mapFromJson(decodedMapJson) MapSaver().saveMap(downloadableMap.name, mapObject) diff --git a/core/src/com/unciv/ui/worldscreen/optionstable/DropBox.kt b/core/src/com/unciv/ui/worldscreen/optionstable/DropBox.kt index ce587fd8..aa8a3006 100644 --- a/core/src/com/unciv/ui/worldscreen/optionstable/DropBox.kt +++ b/core/src/com/unciv/ui/worldscreen/optionstable/DropBox.kt @@ -41,7 +41,7 @@ class DropBox(){ println(ex.message) val reader = BufferedReader(InputStreamReader(errorStream)) println(reader.readText()) - return "Error!" + return "" } } }