Merge pull request #5634 from vnen/assetlib-map-crash

Fix crash on asset lib install
This commit is contained in:
Rémi Verschelde 2016-07-11 00:17:54 +02:00 committed by GitHub
commit 9397458cc0
3 changed files with 8 additions and 3 deletions

View file

@ -1504,6 +1504,8 @@ bool Main::start() {
if (project_manager_request || (script=="" && test=="" && game_path=="" && !editor)) { if (project_manager_request || (script=="" && test=="" && game_path=="" && !editor)) {
ProjectManager *pmanager = memnew( ProjectManager ); ProjectManager *pmanager = memnew( ProjectManager );
ProgressDialog *progress_dialog = memnew( ProgressDialog );
pmanager->add_child(progress_dialog);
sml->get_root()->add_child(pmanager); sml->get_root()->add_child(pmanager);
OS::get_singleton()->set_context(OS::CONTEXT_PROJECTMAN); OS::get_singleton()->set_context(OS::CONTEXT_PROJECTMAN);
} }

View file

@ -600,7 +600,8 @@ void EditorAssetLibrary::_install_asset() {
EditorAssetLibraryItemDownload *d = downloads_hb->get_child(i)->cast_to<EditorAssetLibraryItemDownload>(); EditorAssetLibraryItemDownload *d = downloads_hb->get_child(i)->cast_to<EditorAssetLibraryItemDownload>();
if (d && d->get_asset_id() == description->get_asset_id()) { if (d && d->get_asset_id() == description->get_asset_id()) {
EditorNode::get_singleton()->show_warning("Download for this asset is already in progress!"); if (EditorNode::get_singleton() != NULL)
EditorNode::get_singleton()->show_warning("Download for this asset is already in progress!");
return; return;
} }
} }

View file

@ -317,9 +317,11 @@ void EditorAssetInstaller::ok_pressed() {
} }
msg+=failed_files[i]; msg+=failed_files[i];
} }
EditorNode::get_singleton()->show_warning(msg); if (EditorNode::get_singleton() != NULL)
EditorNode::get_singleton()->show_warning(msg);
} else { } else {
EditorNode::get_singleton()->show_warning("Package Installed Successfully!","Success!"); if (EditorNode::get_singleton() != NULL)
EditorNode::get_singleton()->show_warning("Package Installed Successfully!","Success!");
} }