Skip to content

Commit

Permalink
Fix nullable warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronwhite committed Oct 17, 2023
1 parent b111c9a commit 41babb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/Pinta.Core.Tests/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 98,7 @@ public static ImageSurface LoadImage (string imageFilePath)
var file = Gio.FileHelper.NewForPath (imageFilePath);
using var fs = file.Read (null);
try {
var bg = GdkPixbuf.Pixbuf.NewFromStream (fs, cancellable: null);
var bg = GdkPixbuf.Pixbuf.NewFromStream (fs, cancellable: null)!; // NRT: only nullable when error is thrown.
var surf = CairoExtensions.CreateImageSurface (Format.Argb32, bg.Width, bg.Height);
var context = new Cairo.Context (surf);
context.DrawPixbuf (bg, 0, 0);
Expand Down

0 comments on commit 41babb8

Please sign in to comment.