internal/ui: bug fix: getMetal might return a nil pointer as a non-nil interface

This commit is contained in:
Hajime Hoshi 2022-03-24 13:36:45 +09:00
parent eeb5687b73
commit c61be3c532

View File

@ -47,7 +47,10 @@ func (g *graphicsDriverGetterImpl) getMetal() graphicsdriver.Graphics {
if g.gomobileBuild { if g.gomobileBuild {
return nil return nil
} }
return metal.Get() if m := metal.Get(); m != nil {
return m
}
return nil
} }
func SetUIView(uiview uintptr) { func SetUIView(uiview uintptr) {