blish-hud / Pathing

[Module] The official pathing module which adds marker and trail support to Blish HUD.
https://blishhud.com/docs/markers/
MIT License
12 stars 10 forks source link

Fix object reference not set to an instance of an object. #55

Closed dlamkins closed 2 years ago

dlamkins commented 2 years ago

14:02:03.4323 | FATAL | Blish_HUD.DebugService | Blish HUD encountered a fatal crash! System.NullReferenceException: Object reference not set to an instance of an object. at BhModule.Community.Pathing.Entity.PathingEntity.IsFiltered(EntityRenderTarget renderTarget) in C:\Users\dade\source\repos\Pathing\Entity\PathingEntity.cs:line 131 at BhModule.Community.Pathing.Entity.StandardMarker.RenderToMiniMap(SpriteBatch spriteBatch, Rectangle bounds, ValueTuple`2 offsets, Double scale, Single opacity) in C:\Users\dade\source\repos\Pathing\Entity\StandardMarker.MiniMap.cs:line 17 at BhModule.Community.Pathing.Entity.FlatMap.Paint(SpriteBatch spriteBatch, Rectangle bounds) in C:\Users\dade\source\repos\Pathing\UI\Controls\FlatMap.cs:line 199 at Blish_HUD.Controls.Control.Draw(SpriteBatch spriteBatch, Rectangle drawBounds, Rectangle scissor) in D:\a\Blish-HUD\Blish-HUD\Blish HUD\Controls\Control.cs:line 784 at Blish_HUD.Controls.Container.PaintChildren(SpriteBatch spriteBatch, Rectangle bounds, Rectangle scissor) in D:\a\Blish-HUD\Blish-HUD\Blish HUD\Controls\Container.cs:line 284 at Blish_HUD.Controls.Container.Paint(SpriteBatch spriteBatch, Rectangle bounds) in D:\a\Blish-HUD\Blish-HUD\Blish HUD\Controls\Container.cs:line 261 at Blish_HUD.Controls.Control.Draw(SpriteBatch spriteBatch, Rectangle drawBounds, Rectangle scissor) in D:\a\Blish-HUD\Blish-HUD\Blish HUD\Controls\Control.cs:line 784 at Blish_HUD.GraphicsService.Render(GameTime gameTime, SpriteBatch spriteBatch) in D:\a\Blish-HUD\Blish-HUD\Blish HUD\GameServices\GraphicsService.cs:line 247 at Blish_HUD.BlishHud.Draw(GameTime gameTime) in D:\a\Blish-HUD\Blish-HUD\Blish HUD\BlishHud.cs:line 156 at Microsoft.Xna.Framework.Game.DoDraw(GameTime gameTime) at Microsoft.Xna.Framework.Game.Tick() at MonoGame.Framework.WinFormsGameWindow.TickOnIdle(Object sender, EventArgs e) at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at MonoGame.Framework.WinFormsGameWindow.RunLoop() at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) at Blish_HUD.Program.Main(String[] args) in D:\a\Blish-HUD\Blish-HUD\Blish HUD\Program.cs:line 74

REF: https://discord.com/channels/531175899588984842/534492173362528287/897560680826306560

dlamkins commented 2 years ago

Should be when marker doesn't get a category (similar to the fix I needed for trails that experience the same issue).

dlamkins commented 2 years ago

This was fixed recently when category namespace values on entities were changed to be an actual reference to the category instead of just the raw namespace value.