From 8316be26e61ce9d2aebd6f3b3c443407edec3dbe Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 1 Feb 2016 17:57:41 +0100 Subject: Fix a rare crash due to calling a NULL method pointer (#2390) --- Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Frameworks') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.h b/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.h index d66dfd81..5fa6f406 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.h +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.h @@ -79,7 +79,7 @@ static inline unsigned long long SPMySQLResultStoreGetRowCount(SPMySQLStreamingR { typedef unsigned long long (*SPMSRSRowCountMethodPtr)(SPMySQLStreamingResultStore*, SEL); static SPMSRSRowCountMethodPtr SPMSRSRowCount; - if (!SPMSRSRowCount) SPMSRSRowCount = (SPMSRSRowCountMethodPtr)[self methodForSelector:@selector(numberOfRows)]; + if (!SPMSRSRowCount) SPMSRSRowCount = (SPMSRSRowCountMethodPtr)[SPMySQLStreamingResultStore instanceMethodForSelector:@selector(numberOfRows)]; return SPMSRSRowCount(self, @selector(numberOfRows)); } @@ -87,7 +87,7 @@ static inline id SPMySQLResultStoreGetRow(SPMySQLStreamingResultStore* self, NSU { typedef id (*SPMSRSRowFetchMethodPtr)(SPMySQLStreamingResultStore*, SEL, NSUInteger); static SPMSRSRowFetchMethodPtr SPMSRSRowFetch; - if (!SPMSRSRowFetch) SPMSRSRowFetch = (SPMSRSRowFetchMethodPtr)[self methodForSelector:@selector(rowContentsAtIndex:)]; + if (!SPMSRSRowFetch) SPMSRSRowFetch = (SPMSRSRowFetchMethodPtr)[SPMySQLStreamingResultStore instanceMethodForSelector:@selector(rowContentsAtIndex:)]; return SPMSRSRowFetch(self, @selector(rowContentsAtIndex:), rowIndex); } @@ -95,7 +95,7 @@ static inline id SPMySQLResultStoreObjectAtRowAndColumn(SPMySQLStreamingResultSt { typedef id (*SPMSRSObjectFetchMethodPtr)(SPMySQLStreamingResultStore*, SEL, NSUInteger, NSUInteger); static SPMSRSObjectFetchMethodPtr SPMSRSObjectFetch; - if (!SPMSRSObjectFetch) SPMSRSObjectFetch = (SPMSRSObjectFetchMethodPtr)[self methodForSelector:@selector(cellDataAtRow:column:)]; + if (!SPMSRSObjectFetch) SPMSRSObjectFetch = (SPMSRSObjectFetchMethodPtr)[SPMySQLStreamingResultStore instanceMethodForSelector:@selector(cellDataAtRow:column:)]; return SPMSRSObjectFetch(self, @selector(cellDataAtRow:column:), rowIndex, colIndex); } @@ -103,6 +103,6 @@ static inline id SPMySQLResultStorePreviewAtRowAndColumn(SPMySQLStreamingResultS { typedef id (*SPMSRSObjectPreviewMethodPtr)(SPMySQLStreamingResultStore*, SEL, NSUInteger, NSUInteger, NSUInteger); static SPMSRSObjectPreviewMethodPtr SPMSRSObjectPreview; - if (!SPMSRSObjectPreview) SPMSRSObjectPreview = (SPMSRSObjectPreviewMethodPtr)[self methodForSelector:@selector(cellPreviewAtRow:column:previewLength:)]; + if (!SPMSRSObjectPreview) SPMSRSObjectPreview = (SPMSRSObjectPreviewMethodPtr)[SPMySQLStreamingResultStore instanceMethodForSelector:@selector(cellPreviewAtRow:column:previewLength:)]; return SPMSRSObjectPreview(self, @selector(cellPreviewAtRow:column:previewLength:), rowIndex, colIndex, previewLength); } -- cgit v1.2.3