Its still worth getting the codes read. I had a similar issue. Light came on but no issue with the car. My code reader pointed to the Nitrogen Oxide Sensor. Emission's were fine so it was obviously only the sensor. I cleared the codes and it would do anything between 30 and 300 miles before coming on again after I kept clearing them. As BMW wanted £450 to fit a new one I bought one second hand off a car that had only done 5000 miles for £145. Got local garage to fit it as I couldn't get enough clearance under the car to fit it myself and have not had the issue since.