Null Pointer Exception when calling Graphics.drawString()

I am getting the weirdest error when calling drawString:

this.offScreenG.drawString("Hi", 255, 400);

See, the error doesn't happen everytime I run my program. It seems to happen randomly. offScreenG is a java.awt.Graphics. I am running this in netbeans. The error also randomly happens outside netbeans when running it via a jar file.Here is the error:

Exception in thread "Thread-2" java.lang.NullPointerException

at sun.font.FileFontStrike.getCachedGlyphPtr(FileFontStrike.java:336)

at sun.font.FileFontStrike.getSlot0GlyphImagePtrs(FileFontStrike.java:316)

at sun.font.CompositeStrike.getGlyphImagePtrs(CompositeStrike.java:97)

at sun.font.GlyphList.mapChars(GlyphList.java:254)

at sun.font.GlyphList.setFromString(GlyphList.java:226)

at sun.java2d.pipe.GlyphListPipe.drawString(GlyphListPipe.java:53)

at sun.java2d.SunGraphics2D.drawString(SunGraphics2D.java:2753)

at Screen.ScreenTicketThrow.drawComponents(ScreenTicketThrow.java:377)

at Screen.ScreenTicketThrow.run(ScreenTicketThrow.java:208)

at java.lang.Thread.run(Thread.java:619)

[1126 byte] By [dunebeetle5a] at [2007-11-27 0:54:52]
# 1
You should have declare the variable offScreenG.But have you initialize it ?
rym82a at 2007-7-11 23:27:26 > top of Java-index,Java Essentials,Java Programming...
# 2
Are you doing something funky with fonts?Since the exception is coming from sun.font package (specifically getCachedGlyphPtr method), it's not as simple as having a null graphics.Post a small piece of code showing what you're doing.
-Kayaman-a at 2007-7-11 23:27:26 > top of Java-index,Java Essentials,Java Programming...
# 3

First, I know the graphics is never null, as I have checked for it, plus that object draws everything else on the screen before drawing the string.

Before, I did nothing with fonts, so I added:

this.offScreenG.setFont(new Font("SansSerif", Font.PLAIN, 12));

but I still would get the error sometimes.

I am making a game loop structure, and the error started occuring when changing up some things with my timing stuff and pausing the thread.

Here's all the other places I use the graphics object:

java.awt.Graphics offScreenG = null; ( above constructor)

In the startGame method:

offScreenImage = createImage(512, 512);

offScreenG = offScreenImage.getGraphics();

From there I just use offScreenG to draw to the backbuffer:

this.offScreenG.drawImage(tickets.getImage(),(int)tickets.getXPos(),(int)tickets.getYPos(),null);

this.offScreenG.drawImage(people.getImage(),(int)people.getXPos(),(int)people.getYPos(),null);

this.offScreenG.drawString("Hi", 255, 400); /////Error Here

dunebeetle5a at 2007-7-11 23:27:26 > top of Java-index,Java Essentials,Java Programming...
# 4
Freaking strange.....I put the line in a try block, and I must of ran it 60+ times, but it never throws an exception.
dunebeetle5a at 2007-7-11 23:27:26 > top of Java-index,Java Essentials,Java Programming...