haxeui / haxeui-heaps

MIT License
31 stars 12 forks source link

Null error in heaps target #29

Closed hoseyjoe closed 3 years ago

hoseyjoe commented 3 years ago

Project works in raylib and html5. It throws the below error in Heaps
Simplified.zip

Null access
Called from h2d.TextInput.set_text (h2d/TextInput.hx line 334)
Called from haxe.ui.backend.TextDisplayImpl.validateData (haxe/ui/backend/TextDisplayImpl.hx line 17)
Called from haxe.ui.core.TextInput.validateComponentInternal (haxe/ui/core/TextInput.hx line 354)
Called from haxe.ui.core.TextInput.validateComponent (haxe/ui/core/TextInput.hx line 336)
Called from haxe.ui.core.ComponentValidation.validateComponentInternal (haxe/ui/core/ComponentValidation.hx line 258)
Called from haxe.ui.components.TextArea.validateComponentInternal (haxe/ui/components/TextArea.hx line 55)
Called from haxe.ui.core.ComponentValidation.validateComponent (haxe/ui/core/ComponentValidation.hx line 177)
Called from haxe.ui.validation.ValidationManager.process (haxe/ui/validation/ValidationManager.hx line 128)
Called from haxe.ui.util.$Timer.~delay.1 (haxe/ui/util/Timer.hx line 10)
Called from haxe.ui.backend.$TimerImpl.update (haxe/ui/backend/TimerImpl.hx line 13)
Called from haxe.ui.backend.$BackendImpl.update (haxe/ui/backend/BackendImpl.hx line 7)
Called from haxe.ui.backend.AppImpl.onHeapsUpdate (haxe/ui/backend/AppImpl.hx line 47)
Called from haxe.ui.backend._AppImpl.HeapsApp.update (haxe/ui/backend/AppImpl.hx line 18)
Called from hxd.App.mainLoop (hxd/App.hx line 187)
Called from hxd.App.~setup.2 (hxd/App.hx line 144)
Called from hxd.App.loadAssets (hxd/App.hx line 170)
Called from hxd.App.setup (hxd/App.hx line 140)
Called from h3d.Engine.onCreate (h3d/Engine.hx line 256)
Called from h3d.impl.DirectXDriver.~init.1 (h3d/impl/DirectXDriver.hx line 262)
Called from haxe.$Timer.~delay.0 (C:\SDKs\Haxe\haxe\std/haxe/Timer.hx line 144)
Called from haxe.$Timer.~__constructor__.0 (C:\SDKs\Haxe\haxe\std/haxe/Timer.hx line 76)
Called from sys.thread.EventLoop.progress (C:\SDKs\Haxe\haxe\std/sys/thread/EventLoop.hx line 114)
Called from hxd.$System.runMainLoop (hxd/System.hl.hx line 152)
Called from hxd.$System.runMainLoop (hxd/System.hl.hx line 142)
Called from haxe.$Timer.~delay.0 (C:\SDKs\Haxe\haxe\std/haxe/Timer.hx line 144)
Called from haxe.$Timer.~__constructor__.0 (C:\SDKs\Haxe\haxe\std/haxe/Timer.hx line 76)
Called from sys.thread.EventLoop.loop (C:\SDKs\Haxe\haxe\std/sys/thread/EventLoop.hx line 150)
Called from sys.thread._Thread.$Thread_Impl_.processEvents (C:\SDKs\Haxe\haxe\std/hl/_std/sys/thread/Thread.hx line 62)Null access
Called from h2d.TextInput.set_text (h2d/TextInput.hx line 334)
Called from haxe.ui.backend.TextDisplayImpl.validateData (haxe/ui/backend/TextDisplayImpl.hx line 17)
Called from haxe.ui.core.TextInput.validateComponentInternal (haxe/ui/core/TextInput.hx line 354)
Called from haxe.ui.core.TextInput.validateComponent (haxe/ui/core/TextInput.hx line 336)
Called from haxe.ui.core.ComponentValidation.validateComponentInternal (haxe/ui/core/ComponentValidation.hx line 258)
Called from haxe.ui.components.TextArea.validateComponentInternal (haxe/ui/components/TextArea.hx line 55)
Called from haxe.ui.core.ComponentValidation.validateComponent (haxe/ui/core/ComponentValidation.hx line 177)
Called from haxe.ui.validation.ValidationManager.process (haxe/ui/validation/ValidationManager.hx line 128)
Called from haxe.ui.util.$Timer.~delay.1 (haxe/ui/util/Timer.hx line 10)
Called from haxe.ui.backend.$TimerImpl.update (haxe/ui/backend/TimerImpl.hx line 13)
Called from haxe.ui.backend.$BackendImpl.update (haxe/ui/backend/BackendImpl.hx line 7)
Called from haxe.ui.backend._AppImpl.HeapsApp.update (haxe/ui/backend/AppImpl.hx line 18)
Called from hxd.App.mainLoop (hxd/App.hx line 187)
Called from hxd.App.~setup.2 (hxd/App.hx line 144)
Called from hxd.App.loadAssets (hxd/App.hx line 170)
Called from hxd.App.setup (hxd/App.hx line 140)
Called from h3d.Engine.onCreate (h3d/Engine.hx line 256)
Called from h3d.impl.DirectXDriver.~init.1 (h3d/impl/DirectXDriver.hx line 262)
Called from haxe.$Timer.~delay.0 (C:\SDKs\Haxe\haxe\std/haxe/Timer.hx line 144)
Called from haxe.$Timer.~__constructor__.0 (C:\SDKs\Haxe\haxe\std/haxe/Timer.hx line 76)
Called from sys.thread.EventLoop.progress (C:\SDKs\Haxe\haxe\std/sys/thread/EventLoop.hx line 114)
Called from hxd.$System.runMainLoop (hxd/System.hl.hx line 152)
Called from hxd.$System.runMainLoop (hxd/System.hl.hx line 142)
Called from haxe.$Timer.~delay.0 (C:\SDKs\Haxe\haxe\std/haxe/Timer.hx line 144)
Called from haxe.$Timer.~__constructor__.0 (C:\SDKs\Haxe\haxe\std/haxe/Timer.hx line 76)
Called from sys.thread.EventLoop.loop (C:\SDKs\Haxe\haxe\std/sys/thread/EventLoop.hx line 150)
Called from sys.thread._Thread.$Thread_Impl_.processEvents (C:\SDKs\Haxe\haxe\std/hl/_std/sys/thread/Thread.hx line 62)
hoseyjoe commented 3 years ago

This can be fixed in heaps h2d.TextInput by adding t!=null

override function set_text(t:String) { super.set_text(t); if (t != null && cursorIndex > t.length) cursorIndex = t.length; return t; }

hoseyjoe commented 3 years ago

This appears fixed in current git

ianharrigan commented 3 years ago

Yeah, sorry, forgot to ping