Fix crash when parent project does not have loom
This commit is contained in:
		
							parent
							
								
									8dc84f1449
								
							
						
					
					
						commit
						e49af8ac39
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		|  | @ -31,6 +31,7 @@ import net.fabricmc.loom.providers.MinecraftProvider; | |||
| import net.fabricmc.loom.util.LoomDependencyManager; | ||||
| import org.cadixdev.lorenz.MappingSet; | ||||
| import org.gradle.api.Project; | ||||
| import org.gradle.api.UnknownDomainObjectException; | ||||
| import org.gradle.api.artifacts.Configuration; | ||||
| import org.gradle.api.artifacts.ConfigurationContainer; | ||||
| import org.gradle.api.artifacts.Dependency; | ||||
|  | @ -158,7 +159,11 @@ public class LoomGradleExtension { | |||
| 		}); | ||||
| 
 | ||||
| 		if(dependency == null && !AbstractPlugin.isRootProject(project)){ | ||||
| 			return project.getRootProject().getExtensions().getByType(LoomGradleExtension.class).getLoomVersion(); | ||||
| 			try { | ||||
| 				return project.getRootProject().getExtensions().getByType(LoomGradleExtension.class).getLoomVersion(); | ||||
| 			} catch (UnknownDomainObjectException e){ | ||||
| 				return null; | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		return dependency != null ? dependency.getVersion() : null; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue