Skip to content

Commit

Permalink
Add null check in Utils.cache_image
Browse files Browse the repository at this point in the history
Former-commit-id: eff0aab
  • Loading branch information
tkashkin committed Aug 14, 2018
1 parent 2d61be6 commit 18c3b6a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/utils/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ namespace GameHub.Utils

public static async string? cache_image(string url, string prefix="remote")
{
if(url == null || url == "") return null;
var parts = url.split("?")[0].split(".");
var ext = parts.length > 1 ? parts[parts.length - 1] : null;
ext = ext != null && ext.length <= 6 ? "." + ext : null;
Expand Down

0 comments on commit 18c3b6a

Please sign in to comment.