diff --git a/CHANGELOG.md b/CHANGELOG.md index d40e720..bf60743 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [3.0.0-preview.11](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.10...v3.0.0-preview.11) (2020-05-07) + + +### Bug Fixes + +* If sprite is null, a null exception is thrown ([50c6e98](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/50c6e980ca37dda1bece5252162fa05ca3472ee8)) + # [3.0.0-preview.10](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.9...v3.0.0-preview.10) (2020-04-30) diff --git a/Scripts/UIParticle.cs b/Scripts/UIParticle.cs index d04fb6c..b45235d 100755 --- a/Scripts/UIParticle.cs +++ b/Scripts/UIParticle.cs @@ -90,8 +90,8 @@ namespace Coffee.UIExtensions if (textureSheet.enabled && textureSheet.mode == ParticleSystemAnimationMode.Sprites && 0 < textureSheet.spriteCount) { var sprite = textureSheet.GetSprite(0); - textureSheet.uvChannelMask = (UVChannelFlags) (sprite.packed ? -1 : 0); - tex = sprite.texture; + textureSheet.uvChannelMask = (UVChannelFlags) (sprite && sprite.packed ? -1 : 0); + tex = sprite ? sprite.texture : null; } Profiler.EndSample(); } diff --git a/package.json b/package.json index 0793c78..b31359b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.coffee.ui-particle", "displayName": "UI Particle", "description": "This plugin provide a component to render particle effect for uGUI.\nThe particle rendering is maskable and sortable, without Camera, RenderTexture or Canvas.", - "version": "3.0.0-preview.10", + "version": "3.0.0-preview.11", "unity": "2018.2", "license": "MIT", "repository": {