Return null image in resizeImage if image is null

This commit is contained in:
Joshua Granick
2017-09-22 09:50:54 -07:00
parent cf396919fc
commit cd5aadc747

View File

@@ -16,6 +16,8 @@ class ImageHelper {
public static function rasterizeSVG (path:String, width:Int, height:Int, backgroundColor:Int = null):Image {
//public static function rasterizeSVG (svg:Dynamic /*SVG*/, width:Int, height:Int, backgroundColor:Int = null):Image {
if (path == null) return null;
var temp = PathHelper.getTemporaryFile (".png");
try {
@@ -124,6 +126,8 @@ class ImageHelper {
public static function resizeImage (image:Image, width:Int, height:Int):Image {
if (image == null) return null;
if (image.width == width && image.height == height) {
return image;