fix crash on ScreenView layout if emulator bundle is not loaded

This commit is contained in:
Jesús A. Álvarez 2016-07-01 19:37:44 +02:00
parent 118bfccca9
commit d1a0721b40

View File

@ -24,7 +24,11 @@ static ScreenView *sharedScreenView = nil;
sharedScreenView = self;
videoLayer = [CALayer layer];
[AppDelegate sharedEmulator].screenLayer = videoLayer;
screenSize = [AppDelegate sharedEmulator].screenSize;
if ([AppDelegate sharedEmulator]) {
screenSize = [AppDelegate sharedEmulator].screenSize;
} else {
screenSize = CGSizeMake(1, 1);
}
[self.layer addSublayer:videoLayer];
}