Skip to content

Commit d3663f7

Browse files
authored
Fix texture importer error message (MonoGame#8995)
When the source texture is not found we need to return an appropriate error message.
1 parent f0a1c4a commit d3663f7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

MonoGame.Framework.Content.Pipeline/Builder/ContentBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@ public void BuildAndWriteContent(string relativeSrcPath, ContentInfo contentInfo
164164

165165
if (!ContentBuilderHelper.GetImporter(relativePath, contentInfo.Importer, out IContentImporter importer))
166166
{
167-
Logger.Log(LogLevel.Warning, "Importer: Not found :(");
167+
Logger.Log(LogLevel.Warning, "Importer: Not found");
168168
return null;
169169
}
170170
Logger.Log($"Imposter: {importer.GetType().Name}");
171171
if (!ContentBuilderHelper.GetProcessor(importer, contentInfo.Processor, out IContentProcessor processor))
172172
{
173-
Logger.Log(LogLevel.Warning, "Processor: Not found :(");
173+
Logger.Log(LogLevel.Warning, "Processor: Not found");
174174
return null;
175175
}
176176
Logger.Log($"Processor: {processor.GetType().Name}");

native/pipeline/mgcp_texture.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ void* MP_ImportBitmap(const char* importPath, MGCP_Bitmap& bitmap)
1515
void* data = nullptr;
1616

1717
f = stbi__fopen(importPath, "rb");
18-
if (!f) goto err;
18+
if (!f)
19+
return (void*)"The file was not found.";
1920

2021
if (stbi_is_hdr_from_file(f))
2122
{

0 commit comments

Comments
 (0)