Skip to content

Commit dba7bc3

Browse files
committed
check status in DrawString and DrawImageString
1 parent 15009d9 commit dba7bc3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Guitor.winxed

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,11 +1345,15 @@ class Drawable
13451345
}
13461346
function DrawString(int x, int y, string str)
13471347
{
1348-
self.getgc().DrawString(self.display, self, x, y, str);
1348+
var gc = self.getgc();
1349+
if (gc != null)
1350+
gc.DrawString(self.display, self, x, y, str);
13491351
}
13501352
function DrawImageString(int x, int y, string str)
13511353
{
1352-
self.getgc().DrawImageString(self.display, self, x, y, str);
1354+
var gc = self.getgc();
1355+
if (gc != null)
1356+
gc.DrawImageString(self.display, self, x, y, str);
13531357
}
13541358
function getTextWidth(string text)
13551359
{

0 commit comments

Comments
 (0)