The measurement-device-independent quantum random number generator (MDI-QRNG) can resist all security loopholes on measurement devices, and it thus seems very promising in practical implementations. In the MDI-QRNG, sources are often assumed to be perfectly prepared, however, there inevitably exist errors in the quantum state preparation process due to imperfections in realistic equipments and devices. In this paper, we do investigations on the MDI-QRNG with source flaws, showing its performance at different state errors. Besides, we also consider the influence of the finite-size effect, and compare the performance of different sources in MDI-QRNGs. This work provides valuable references for practical implementation of MDI-QRNGs.