diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 976d210c2..145a6b464 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -310,7 +310,7 @@ static FUINT HWR_CalcSlopeLight(FUINT lightnum, pslope_t *slope, const sector_t { INT16 finallight = lightnum; - if (slope != NULL && P_ApplyLightOffsetFine(lightnum, sector)) + if (slope != NULL && sector != NULL && P_ApplyLightOffsetFine(lightnum, sector)) { finallight += slope->hwLightOffset;