Bug 1360613 - Don't call BorrowDrawTarget on a null texture. r?ethlin
MozReview-Commit-ID: EtBMTwA5mcB
--- a/gfx/layers/UpdateImageHelper.h
+++ b/gfx/layers/UpdateImageHelper.h
@@ -44,17 +44,20 @@ public:
if (mIsLocked) {
mTexture->Unlock();
mIsLocked = false;
}
}
already_AddRefed<gfx::DrawTarget> GetDrawTarget()
{
- RefPtr<gfx::DrawTarget> target = mTexture->BorrowDrawTarget();
+ RefPtr<gfx::DrawTarget> target;
+ if (mTexture) {
+ target = mTexture->BorrowDrawTarget();
+ }
return target.forget();
}
bool UpdateImage()
{
if (!mTexture) {
return false;
}